Is there any way to convert varbinary to ASCII varchar string (base64, md5, sha1 – no matter) without master.dbo.fn_varbintohexstr function on MS SQL Server 2005? Because it can’t be used inside of computed column.
CONVERT and CAST return non-ASCII strings.
Thank you,
Denis.
For md5 and sha1 you can use hashbytes. To get base64 you can create a udf that does the conversion and use that in your computed column.
Function BinToBase64:
Function BinToHexString:
Use like this:
Unique constraint varbinary column using hashbytes and an uniqueidentifier column