How to check if a string is a uniqueidentifier?

前端 未结 12 910
小蘑菇
小蘑菇 2020-11-29 03:06

Is there an equivalent to IsDate or IsNumeric for uniqueidentifier (SQL Server)? Or is there anything equivalent to (C#) TryParse?

Otherwise I\'ll have to write my o

12条回答
  •  渐次进展
    2020-11-29 03:59

    I am not aware of anything that you could use "out of the box" - you'll have to write this on your own, I'm afraid.

    If you can: try to write this inside a C# library and deploy it into SQL Server as a SQL-CLR assembly - then you could use things like Guid.TryParse() which is certainly much easier to use than anything in T-SQL....

提交回复
热议问题