Tables contains XML columns

Return table name with schema which contains xml columns in databases

SELECT [Table] = s.name + N'.' + t.name
FROM sys.tables t
   INNER JOIN sys.schemas s
	 ON t.[schema_id] = s.[schema_id]
WHERE EXISTS
(
   SELECT 1 FROM sys.columns c
   WHERE c.[object_id] = t.[object_id]
   AND c.system_type_id = 241 -- 241 = xml
);
Spread the love

Leave a Comment