title: How to convert varbinary to GUID in TSQL stored procedure?
body: <p>how can I convert the HASHBYTES return value to a GUID?</p>
  
  <p>This is what I have so far.</p>
  
  <pre><code>CREATE PROCEDURE [dbo].[Login]
      @email nvarchar,
      @password varchar
  AS
  BEGIN
      DECLARE @passHashBinary varbinary; 
      DECLARE @newPassHashBinary varbinary;
  
      -- Create a unicode (utf-16) password
      Declare @unicodePassword nvarchar;
      Set @unicodePassword = CAST(@password as nvarchar); 
  
      SET @passHashBinary = HASHBYTES('md5', @password);
      SET @newPassHashBinary = HASHBYTES('md5', @unicodePassword);
  </code></pre>