Guest User

Untitled

a guest
Nov 9th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.98 KB | None | 0 0
  1. SET IDENTITY_INSERT [portal_cliente_online_tortal].[dbo].[Usuario] ON;
  2. INSERT INTO [portal_cliente_online_tortal].[dbo].[Usuario]
  3.     (id, cnpj, cd_equipe_venda, cd_escritorio_venda, cpf, email, email_token, fl_ativo, fl_verificado, login, senha)
  4. SELECT
  5.     u.id AS id,
  6.     1 AS cnpj, --case when LEN(u.cpf_CNPJ) > 11 then u.CPF_CNPJ else NULL end as cnpj,
  7.     1 AS cd_equipe_venda, --cast(u.CD_ASSESSOR as int) as cd_equipe_venda,
  8.     1 AS cd_escritorio_venda, --cast(u.CD_ESCRITORIO_VENDA as int) as cd_escritorio_venda,
  9.     2 AS cpf, --case when LEN(u.CPF_CNPJ) = 11 then u.CPF_CNPJ else NULL end as cpf,
  10.     'email' AS email, --u.EMAIL as email,
  11.     'token' AS email_token, --u.TOKEN_VERIFICACAO_EMAIL as email_token,
  12.     1 AS fl_ativo, --u.FL_ATIVO as fl_ativo,
  13.     1 AS fl_verificado, --u.FL_EMAIL_VERIFICADO as fl_verificado,
  14.     'login' AS login, --u.LOGIN as login,
  15.     'PwViAZempBlrbA' AS senha
  16. FROM [portal_cliente_online].[dbo].[TB_USUARIO] u;
  17. SET IDENTITY_INSERT [portal_cliente_online_tortal].[dbo].[Usuario] OFF;
Advertisement
Add Comment
Please, Sign In to add comment