Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy a MS SQL DB for Working Archive

Status
Not open for further replies.

lifegard2

IS-IT--Management
Joined
Mar 28, 2002
Messages
250
Location
US
I'm a complete MS SQL Server newbie. I know how to spell it and that's about it.

Essentially, I need to create a copy of an existing database for archive purposes. I need all the data and structures in the copy (the copy should be identical, in every way, to the original). The copy will have a name with some date format (i.e. name_YYYYMMDD) to allow for archival. This only needs to happen when the user requests it (which will probably only be a few times a year).

Once the copy is made, I need a way to easily compare and validate that both databases are identical.

Once that is done, I need to delete all the records in a single table of the original db. After that, I need to reset the auto numbering for the new records for the table.

At the moment, we are creating a backup, restoring the backup with a different name, and spot checking a few records in both databases. Is there an easier way to automate this, or should I just write up a procedure for the end user to do it manually?
 
Do you have access to Books Online? Look into backup and restore procedures or script your entire database. This will give you an exact duplicate or copy. To reset the numbering Script the table and include the drop and recreate option. Ashley L Rickards
SQL DBA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top