Sorry for my ignorance, but I want to store hashed password in my database,
How can use the HASHBYTES
method to store hashed password in Users
table ?
CREATE TABLE [Users](
EmailAddress NVARCHAR(320) UNIQUE,
UserID INT IDENTITY(1,1) PRIMARY KEY,
UserPassword NVARCHAR(32), -- I Edited the length
FirstName VARCHAR(256) not null,
LastName VARCHAR(256) not null,
MobileNumber BIGINT,
)
--I checked and found this is how to hash a password
declare @afterhash varbinary(256) = HASHBYTES('SHA2_256', 'P@ssw0rd')
But how do I combine them both ?