sha256 function in SQL Server

setzamora picture setzamora · Mar 17, 2011 · Viewed 58.8k times · Source

Is there a built-in sha256 function in SQL Server? I can't find a sha256 T-SQL function source code either. Anyone who has an alternative?

Answer

Soheil Bakhshi picture Soheil Bakhshi · Jul 9, 2013

SQL Server 2012 supports SHA2_256 and SHA2_512.

 SELECT HASHBYTES('SHA2_256','something')