Thursday, March 29, 2018

MSSQL: 隨機生成32bit字串

用MD5隨機生成字串︰
print SUBSTRING(master.dbo.fn_varbintohexstr(HashBytes('MD5', cast(NEWID() as nvarchar(max)))), 3, 32)

No comments: