• leaders_j that code snippet you have is really old; i bet it's from 5 years ago.

    It's from a project i play with now and then that scripts any table via TSQL.

    are you trying to script the CREATE table statements?

    i've got some really advanced versions of that code since i wrote that, that are no longer cursor based.

    try this version for now:

    Get any Tables DDL via TSQL

    my newest version (v309) scripts any object act all(procedure/function/table/view etc.

    I should note that everything my script does, the GUI does, and probably better, but i love writing my own solutions.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!