Monday, March 19, 2012

How to recreate a blank copy of dbs

I want to create a clean copy of my DB now that it is done. So it can be moved to another Server. It has some sample data in some tables that I would like to keep and some in other table that I don't. How can I do this?

Hi. I have two possible solutions:

1. You can generate a script with all the database objects: in enterprise manager right click over the database --> all tasks --> generate sql script... and in options tab include indexes, triggers, primary keys, etc.

For the tables you need with data, you could add the necessary inserts commands... but only if there are few rows.

2. Backup yuor database, and restore it in a new database with other name... delete data you don't need and use this new database as your "empty" databse

No comments:

Post a Comment