I have a very large database (400GB) that is now corrupted. I tried repairing it with the repair_allow_data_loss
option, but that did not fix the problem so my next option is to restore to a previous version. What I want to do first it to create a new fresh copy of the database. So a database with all the tables/views/procedures/permissions like the existing one and then restore to it an older backup.
How can I create this fresh copy?
Best Answer
Taking into account a 400GB database, its upto you to choose any of the below routes :
Method 1 : Backup and Restore
Depending on your hardware and the amount of activity going on, it will be slower than Method 2 - BCP OUT / BCP IN
Below is the script that will help you :
Method 2 - BCP OUT / BCP IN
Script out the database SCHEMA_ONLY and recreate an empty database on the same server with a different Name.
Use BCP OUT and BULK INSERT to insert data. Below script will help you with that :