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
 SQL Database is corrupted....... plz help.

Author  Topic 

shampur
Starting Member

1 Post

Posted - 2014-08-21 : 18:25:10
Respected Sir,

unfortunately hard disk of my system is damaged, now i recovered my database. but it cannot be attached again to SQL management studio 2005.
the error is myfile.mdf is not a primary database file. (SQL server , error 5171)

plz sir help me...

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-08-21 : 18:41:23
Do you not have SQL backups?

What are the other file extensions in that folder? That error makes it sound like you need to attach a different file.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2014-08-23 : 02:39:00
Could you supply the full error message? Where is your primary database file?

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

Lincolnburrows
Yak Posting Veteran

52 Posts

Posted - 2014-08-23 : 07:48:01
Hi Shampur
Unfortunately some situation happens when your efforts become useless but never lose hope. For this you must read and try some suggestions to attach MDF file.
[url]http://blog.sqlauthority.com/2014/02/11/sql-server-systools-sql-recovery-software-an-experiment-to-recover-database-corruption/[/url]
Go to Top of Page

prett
Posting Yak Master

212 Posts

Posted - 2014-09-02 : 04:17:35
Hi Shampur,

Try to attach your database with 'sp_attach_db'. Another possible remedy is to use 'CREATE DATABASE' command with the 'FOR ATTACH' clause.

Click here for details: http://www.stellarsqldatabaserecovery.com/repair-mssql-error5171.php
Go to Top of Page
   

- Advertisement -