saving database

  • Hello, All:

       I have a question...  I want to make a copy the structure of my database which means I only want the table schemas, not data. However, I only know how to save the whole database, instead of the database structure. Please help me if you know the solution. Thank you!!!

  • In Enterprise Manager expand your database and choose tables. If you want to copy more than one table hold down the shift key and use your arrow keys to highlight the tables.

    Right click and choose all tasks and Generate SQL Script.

    You can make changes by using the tabs. Copy the scrip and past it in query analyser .....

     


    Andy.

  • Hi, Andy:

       Thanks for the reply. Really appreciate it! I generated the script of one database, then run the script generated in another database. The tables were created , but the primary keys were not in the tables... Why? Does user need to create the keys after running the script???

  • Hi

    When you right click on the table to generate a script there are three tabs

    General -- Formatting -- Options

    Click on options and there you can tick script indexes and primary keys!

     


    Andy.

  • Got it!!!  Thank you~

Viewing 5 posts - 1 through 4 (of 4 total)

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