Identify Tables Storing GUID Values

You can identify tables that store a GUID (Globally Unique Identifier) value with the following script:

SELECT [table] = + N'.' + t.nameFROM sys.tables AS tINNER JOIN sys.schemas AS sON t.[schema_id] = s.[schema_id]WHERE EXISTS(SELECT 1 FROM sys.columns AS cWHERE c.[object_id] = t.[object_id]AND c.system_type_id = 36 -- uniqueidentifier); 
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Related Posts