在存储过程里,如何把字符串转换成uniqueidentifier类型

2025年02月28日 14:01
有2个网友回答
网友(1):

除非你的字符串格式与uniqueidentifier类型一致,且能转换为16进制

网友(2):

begin try
print convert(uniqueidentifier,‘字符串’)
end try
begin catch
print '转换失败'
end catch

'C575BF35-ABA2-4B6B-96BD-1B83BA51B82C‘我这里uniqueidentifier类型是这样的,