SQL Server : Generate MD5 hash string with T-SQL

Here is the code to generate MD5 hash of an email address:

select convert(varchar(32), hashbytes('MD5', 'Test@email.com'), 2)

It will return a 128 bit hash
F71EC72738666D7E6177DFF360BBFA0F

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s