Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)

  • RE: Schema comparison

    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...

  • RE: List all tables without LOB columns

    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

  • RE: List all tables without LOB columns

    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')

Viewing 3 posts - 1 through 3 (of 3 total)