Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Posts
    10

    Question Unanswered: Export schema/DDL

    Hey folks,

    I am looking for a way to export the DDL for table objects from MS SQL 2K. In EM you can right click a table, select "All Tasks" then "Generate SQL". When you preview the script, you can copy it to the text editor of your choice and save it. I'd like to find a way to do this programatically - either through TSQL commands or DTS would be best. I'm OK to do VBScript w/in DTS but I'm not up to writing a full blown VB app.

    I seem to remember in my Sybase days that there was a utility called "defncopy" that could be used to extract DDL but there seems to be no analogue in MS SQL 2K.

    The purpose of all this is to extract the data and schema of a table in ASCII text so that we can zip it and burn to CD for archiving purposes.

    Any help appreciated!

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    You need version control if your db is in such a state of flux....

    but that's just my own opinion (MOO)
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Feb 2004
    Posts
    10
    Originally posted by Brett Kaiser
    You need version control if your db is in such a state of flux....

    but that's just my own opinion (MOO)

    Brett - nothing here to indicate "a state of flux" simply we need to be able to extract and archive the structure and data within these tables. We are archiving data that has gone stale and attempting to reduce the utilization on our hard drives. Unfortunately the restrictions of our industry require us to keep the data for a long period of time even if it is not "live".

    Stick to the technical question at hand, MOO elsewhere please.

  4. #4
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    Follow the Nigel's script from this link http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=32519 to create the script.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  5. #5
    Join Date
    Feb 2004
    Posts
    10
    Originally posted by Satya
    Follow the Nigel's script from this link http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=32519 to create the script.
    Thank you this seems like it will do the trick or serve as a basis for moddification.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •