Is there an equivalent to SHA1() in MS-SQL?

GEOCHET picture GEOCHET · Oct 8, 2008 · Viewed 30.2k times · Source

Converting a couple stored procedures from MySQL to Microsoft SQL server. Everything is going well, except one procedure used the MySQL SHA1() function. I cannot seem to find an equivalent to this in MS-SQL.

Does anyone know a valid equivalent for SHA1() on MS-SQL?

Answer

Joel Coehoorn picture Joel Coehoorn · Oct 8, 2008

SQL Server 2005 and later has the HashBytes() function.