Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Data Corruption Issues
 Can't Attach Database

Author  Topic 

jRomeo
Starting Member

3 Posts

Posted - 2008-11-21 : 02:10:07
Hi:

I have a database created in SQL Server 2005 Express Edition. As fate would have it the drive on which the mdf and ldf files of that database reside became corrupted last week. In fact, I had to replace the entire PC.

I recovered the data from the bad hard drive. Trouble is, when I try to attach it to the new installation of SS2K5 EE, I receive an error that the mdf file is "not a primary database."

Am i skee-rood, or is there hope? How can I recover this DB? Here's a link to the error message.

http://www.southtechinc.com/db_error.jpg

Thanks in advance.

jRomeo

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-11-21 : 02:44:54
Seems the database header is corrupt.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-11-21 : 05:18:45
moved to proper forum.

_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.1 out!
Go to Top of Page

jRomeo
Starting Member

3 Posts

Posted - 2008-11-21 : 12:19:50
quote:
Originally posted by Peso

Seems the database header is corrupt.



E 12°55'05.63"
N 56°04'39.26"




Is there a way to recover the db?
Go to Top of Page

tosscrosby
Aged Yak Warrior

676 Posts

Posted - 2008-11-21 : 16:55:30
Do you have a good backup that can be restored?

Terry
Go to Top of Page

jRomeo
Starting Member

3 Posts

Posted - 2008-11-21 : 19:13:05
quote:
Originally posted by tosscrosby

Do you have a good backup that can be restored?

Terry



The error I received above came from the backup copy.
Go to Top of Page

paulrandal
Yak with Vast SQL Skills

899 Posts

Posted - 2008-11-22 : 17:14:54
In your own words, yes, you're 'skee-rood'. There's no way to salvage that database as the primary data file is corrupt. Even doing the attach-a-suspect-database trick won't work as the database simply won't start up.

Paul S. Randal, SQL Server MVP
Author of SQL 2005 DBCC CHECKDB/repair code
Author & Instructor of Microsoft Certified Master - Database course
Managing Director, SQLskills.com (www.SQLskills.com/blogs/paul)
Go to Top of Page
   

- Advertisement -