• SteveBell (2/20/2013)


    Hi Todd,

    I just tried your script and I like it!

    Thanks!

    SteveBell (2/20/2013)


    A couple of questions:

    Uhoh..

    SteveBell (2/20/2013)


    1. Can it be modified to loop through all tables in a database automatically and show the results?

    Yes but not by me yet; you will need to set up an outer loop using a Cursor or a WHILE statement or somesuch. Maybe later...

    SteveBell (2/20/2013)


    2. For the datatypes that it can't handle (uniqueidentifier, image, text) it generates an exception and stops processing. Is it possible that it could simply skip the columns with these datatypes and produce an output of the remaining columns?

    Try adding this bolded line:

    WHERE TABLE_CATALOG+'.'+TABLE_SCHEMA+'.'+TABLE_NAME=@Cat_Sch_TableName

    AND DATA_TYPE NOT IN ('uniqueidentifier','image','text') -- excluded types