Question

Locked

SQL database fix

By michael.morrison ·
We have a legal program that uses SQL express 2005. Somehow the company is saying our database has become corrupted and needs to be sent to a company to be rebuilt or fixed. The database sits on an external hard drive. We had to reload windows on the machine that it sits on. when we tried to reattach the database afterwards, we couldn't. Is there a cheap or software out there that I can use to fix it?

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

SQL database fix

by RuneLassen In reply to SQL database fix

So you have only the .mdf and .ldf files?
The only thing left to try is:
1) take a copy of the ORIGINAL .mdf file (it's far better if it's the file as it looked BEFORE you attempted to attach it -- the attach attempt itself will modify the file)
2) if the db has only the one primary fg, attempt to do a "sp_attach_single_file_db" on the file.
If it has multiple fgs, primary and one or more secondaries, you will have to use CREATE DATABASE ... WITH ATTACH_REBUILD_LOG

For example, select "New Query" from withn Express, then issue this command:

EXEC sp_attach_single_file_db 'Db_Attach_Test',
'x:\path\to\primary\data\file\primarydatafile.mdf'
Also have a look this Recommended actions
http://itknowledgeexchange.techtarget.com/itanswers/it-seems-our-sql-database-is-corrupted/

Collapse -

Sql recovery

by zabethharrell In reply to SQL database fix

Relevant solution to recover damaged SQL MDF & NDF file and doesn’t make any kind of changes to SQL database, while repairing them it also recover all components like tables, functions, stored procedures, views, constraints, triggers and more.See at: http://www.mannatsoftware.com/stellar-phoenix-sql-server-recovery.html

Back to Windows Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums