преобразовать SQL Server Guid в Varbinary
select cast(hashbytes('md5','foo') as uniqueidentifier)
Wide-eyed Worm
select cast(hashbytes('md5','foo') as uniqueidentifier)