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
You can write your own UDF. This is a simple approximation to avoid the use of a SQL-CLR assembly.
CREATE FUNCTION dbo.isuniqueidentifier (@ui varchar(50))
RETURNS bit AS
BEGIN
RETURN case when
substring(@ui,9,1)='-' and
substring(@ui,14,1)='-' and
substring(@ui,19,1)='-' and
substring(@ui,24,1)='-' and
len(@ui) = 36 then 1 else 0 end
END
GO
You can then improve it to check if it´s just about HEX values.