I’m storing encrypted passwords in the database, It worked perfect so far on MachineA. Now that I moved to MachineB it seems like the results gets corrupted in the table.
For example: ù9qÆæ\2 Ý-³Å¼]ó will change to ?9q??\2 ?-³?¼]? in the table.
That’s the query I use:
ALTER PROC [Employees].[pRegister](@UserName NVARCHAR(50),@Password VARCHAR(150))
AS
BEGIN
DECLARE @Id UNIQUEIDENTIFIER
SET @Id = NEWID()
SET @password = HashBytes('MD5', @password + CONVERT(VARCHAR(50),@Id))
SELECT @Password
INSERT INTO Employees.Registry (Id,[Name],[Password]) VALUES (@Id, @UserName,@Password)
END
- Collation: SQL_Latin1_General_CP1_CI_AS
- ProductVersion: 10.50.1600.1
Thanks
You are mixing 2 datatypes:
Demo:
Note: I’d also consider salting the stored password with something other than ID column for that row