sqlserver数据库中生成随机数

有下划线:

select NEWID()

无下划线:
select replace(newid(),'-','')

原文地址:https://www.cnblogs.com/JoeYD/p/14943144.html