Copying a SQL Server 2000 database structure to another database

  • Hi -- I have a production database (called "production", say), and I want to copy *just* the structure to another SQL Server database that could be called "test". This would be on the same server & everything.

    I have been trying all sorts of things in Enterprise Manager to no avail -- I would have thought this would be a fairly common requirement, & therefore maybe simple to implement?

    Evidently not as simple as me, anyway...

    Can anyone help with this?

    Cheers,

    doug.

  • You can script the structure out - In Enterprise Manager, right click the database, All Tasks and Generate SQL script...then chose whatever options you need and that will generate the SQL script for you which you can take an execute elsewhere to create just the structure.

    Or you can take a back-up and restore it and then run a truncate script on it to get rid of the data.

    Or in DTS, you can also use the "Copy SQL Server Object Task" and un-select the "Copy Data" option.  It will essentially do the same as #1 above...it will script it out and then create an empty database structure for you.

  • Thanks very much for that -- it pointed me in the right direction.

    What I did was create a test db, went to DTS & clicked to export data, then exported the empty structure to the test db.

    Thanks again,

    doug.

Viewing 3 posts - 1 through 2 (of 2 total)

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