SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Data Corruption Issues
 SQL Database is corrupted....... plz help.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

shampur
Starting Member

1 Posts

Posted - 08/21/2014 :  18:25:10  Show Profile  Reply with Quote
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

USA
36985 Posts

Posted - 08/21/2014 :  18:41:23  Show Profile  Visit tkizer's Homepage  Reply with Quote
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
Flowing Fount of Yak Knowledge

United Kingdom
2062 Posts

Posted - 08/23/2014 :  02:39:00  Show Profile  Visit jackv's Homepage  Reply with Quote
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
Starting Member

34 Posts

Posted - 08/23/2014 :  07:48:01  Show Profile  Reply with Quote
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.
http://blog.sqlauthority.com/2014/02/11/sql-server-systools-sql-recovery-software-an-experiment-to-recover-database-corruption/
Go to Top of Page

prett
Posting Yak Master

USA
202 Posts

Posted - 09/02/2014 :  04:17:35  Show Profile  Visit prett's Homepage  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000