convert sql server guid to varbinary code example Example: convert sql server guid to varbinary select cast(hashbytes('md5','foo') as uniqueidentifier)