Is it possible to generate a SHA-256 hash of a string from a stored procedure in Sql Server 2008?
For deployment reasons, I’d prefer it in TSQL.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Update: SQL Server 2012 HASHBYTES() now supports SHA-256 and SHA-512 out of the box.
Sure. You can do it in TSQL, but it will be much easier to implement it as a CLR Stored procedure.
Here’s an actual example, that simply uses the .NET Framework types: Let’s Hash a BLOB