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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy data and indexes etc. from one DB to another

Status
Not open for further replies.

MrMystery

Technical User
Apr 24, 2002
39
GB
I have a corrupt database, but I am able to read the data in every table except one (670 tables)
My most recent good backup is on a tape stored off-site and will take some time to collect.
I am thinking that it may be quicker to create a new database, and copy in all of the good tables from the old.
Does anyone have any advice on the best way to do this?
 
Yes I have.
I have tried

DBCC checkdb ('dbname',REPAIR_REBUILD)

and it returns errors indicating that the problem is not 'self fixable'
 
Can you make a backup of the current database or does backup fail because of the error? If you can perform a backup, then you could just drop and create the bad table in the current databse. Alternately,you could rename the table and then create a new table.

If these options won't work, I recommend using the Copy Database Wizard in SQL 2000. Or exporting the database to a different name in on the same server in SQL 7. Make sure options are set to copy indexes, key, users, etc. Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
I am able to backup the database no problem.
However, it won't let me drop the bad table because of the corruption.
I am using SQL 7.
How can I export an entire database to another with a new name?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top