How do I get the table definition ?

  • I am definitely familiar with SSIS.

    Give me a clue here.

    I guess I am not explaining myself clearly. What I need is the same script that can be generated

    via a a menu item ( Right Click on Database and then select "TASKS" and "GENERATE SCRIPTS" )

    be able to be produced via a SSIS script.

  • I read the completer thread (now). I believe you are not able to generate the resultset (data dictionary) as the first step. If your query gives the output you are looking for, you may redirect it to a file.

  • does this help?

    http://www.sqlservercentral.com/scripts/T-SQL/67149/

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • Yes Sir!

    This will do

    I may have to modify the script to take care of some quirks but for now, This is the best!

    The script only covers tables in the dbo schema. Some of our tables sit inside other schemas.

    Anyway, this will help. Thanks!

  • I would suggest that you search these forums for DMO or SMO which can generate some very nice scripts.

  • May I ask what stands for DMO and SMO

    ( In this new age we are bombarded with two many mnemonics )

  • SQL Database Management Objects (SQL-DMO)

    http://msdn.microsoft.com/en-us/library/ms131540.aspx

    Getting Started in SMO

    http://msdn.microsoft.com/en-us/library/ms162547.aspx

  • You can also use INFORMATION_SCHEMA.COLUMNS to get table structure.

  • Leela Krishna (1/10/2012)


    You can also use INFORMATION_SCHEMA.COLUMNS to get table structure.

    Does that include indexes, constraints, triggers, and extended properties (for the table and the columns)? How about dependencies? Security access/denials on database user accounts that apply to the table? Same for the schema the table is in, does it have the definition and security properties of that?

    Those are properly part of a table definition, and necessary if you want to document the object properly.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 9 posts - 16 through 23 (of 23 total)

You must be logged in to reply to this topic. Login to reply