I'm trying to write a Stored Procedure which'll get a string, hash it with SHA1 and then return the hash. I can't seem to make it return @hashedString. I'll admit I'm a total beginner with T-SQL.
I'm writing the T-SQL directly in the db.
This is what I've gotten up to now:
ALTER PROCEDURE dbo.ConvertToHash ( @stringToHash nvarchar(256), @hashedString nvarchar(256) OUTPUT ) AS DECLARE @HashThis nvarchar(256); SELECT @HashThis = CONVERT(nvarchar(256), @stringToHash); SELECT @hashedString = HashBytes('SHA1', @HashThis);