Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2003
    Posts
    3

    Unanswered: Can I generate a SQL CREATE script for a table that exists in the db automatically?

    I'm trying to figure out what the easiest/best way to transfer just one table from one sql server to another. Any help would be appreciated. Thanks!

  2. #2
    Join Date
    Dec 2002
    Location
    Antwerp, Belgium
    Posts
    227
    you can use the query analyzer, select database --> user tables --> select correct table --> right click --> script object to new window as -->> create. The query analyzer will generate a script that will generate your table.
    Johan

  3. #3
    Join Date
    Aug 2003
    Posts
    3
    Thanks for the quick reply!
    However, I can't seem to find the "user tables-->select correct table" option in the query analyzer???
    Thanks again!

  4. #4
    Join Date
    Dec 2002
    Location
    Antwerp, Belgium
    Posts
    227
    At the left side is the object browser. If you cannot see, push the F8 button. You see at the top your server and below the databases in that server. From that point on it's like the Windows Explorer. When you see the user tables you can select one and right click on it for the scripting.
    Johan

  5. #5
    Join Date
    Aug 2003
    Posts
    3
    Is this a SQL 2000 thing? I'm on SQL 7.0

  6. #6
    Join Date
    Dec 2002
    Location
    Antwerp, Belgium
    Posts
    227
    don't know, never used sql 7. Something else you can try: in the enterprise manager, select the table you want to script. Right click on it, select all tasks and then generate script. A popup will appear and if you want you can set some preferences, but just pushing OK is sufficient. Hopefully this is in sql 7
    Johan

  7. #7
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    You can access this through enterprise manager by right-clicking on the table and selecting All Tasks, Generate SQL Script.

    Note that this does not copy the actual data. To do that you will need to use DTS.

    blindman

Posting Permissions

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