Viewing 3 posts - 1 through 3 (of 3 total)
Left joins , extra join and checks can be ommitted in order to make it more simple. Here is the version i m referring to
WITH column_compare AS (
SELECT
src_col.TABLE_NAME...
October 10, 2011 at 1:46 am
Most simplified form 🙂
SELECT '['+SCHEMA_NAME(SCHEMA_ID)+'].['+name+']' TableName
FROM Sys.tables WHERE name NOT IN (
SELECT Distinct ic.TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS ic
WHERE ic.DATA_TYPE IN('text', 'ntext', 'image')
OR CHARACTER_MAXIMUM_LENGTH = '-1')
Aqeel Ahmed
October 10, 2011 at 1:38 am
More simplified form:-)
SELECT '['+SCHEMA_NAME(SCHEMA_ID)+'].['+name+']' TableName
FROM Sys.tables WHERE name NOT IN (
SELECT Distinct ic.TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS ic
INNER JOIN Sys.tables st ON ic.TABLE_NAME=st.name
WHERE ic.DATA_TYPE IN('text', 'ntext', 'image')
OR CHARACTER_MAXIMUM_LENGTH = '-1')
October 10, 2011 at 1:35 am
Viewing 3 posts - 1 through 3 (of 3 total)