Last active
July 22, 2020 12:21
-
-
Save ritacse/775fc5f7497c7714ce366ea6ab22cd0b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---- MD5Hash in SQL | |
DECLARE @password varchar(10)='12345789' | |
SELECT CONVERT(VARCHAR(32), HashBytes('MD5', @password), 2) as MD5Hash | |
--- Data Migration from plain text to MD5Hash | |
INSERT INTO [dbo].[E_SS_User_T] | |
([UserName] ,[UserPassword] ,[UserTypeCode] ,[UserEmployeeID] ,[UserEmpName] ,[UserEmpDesignation] ,[UserIsActive] ,[UserNote] ,[UserCreator] ,[UserCreationDate] ) | |
SELECT usr.[name] , CONVERT(VARCHAR(32), HashBytes('MD5', [password]), 2) as MD5Hash,2 ,emp.AutoId,emp.name, desig.name, usr.isActive,'Migrate From DCTL_STORE' , 31725 ,GETDATE() | |
FROM [DCTL_STORE].[dbo].[user_t] usr inner join | |
[DCTL_STORE].dbo.employee_t emp On usr.employee_id=emp.id inner join | |
[DCTL_STORE].dbo.designation_t desig On desig.code=emp.designation_code | |
where emp.isActive=1 and emp.AutoId=31725 and usr.ComplianceType=1 | |
order by emp.AutoId |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment