How to check if a string is a uniqueidentifier?

前端 未结 12 931
小蘑菇
小蘑菇 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:41

    Like to keep it simple. A GUID has four - in it even, if is just a string

    WHERE column like '%-%-%-%-%'

提交回复
热议问题