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
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 problem attach a mdf file

Author  Topic 

yashveertyagi
Starting Member

1 Post

Posted - 2014-10-07 : 02:12:05
TITLE: Microsoft SQL Server Management Studio
------------------------------

Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

E:\krishak.mdf is not a primary database file. (Microsoft SQL Server, Error: 5171)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=5171&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------


yst

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-10-07 : 11:52:18
The error seems to indicate that you don't have all of the necessary data files.

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-10-09 : 01:48:20
There are some other reasons on this post "Error 5171 – mdf is not a primary database file "
http://www.sqlserver-dba.com/2014/03/error-5171-mdf-is-not-a-primary-database-file.html

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

Lincolnburrows
Yak Posting Veteran

52 Posts

Posted - 2014-10-10 : 08:18:17
The MDF file which you are trying to attach is becomes corrupted so you need to repair it first or restore it with help of good backup.
Go to Top of Page
   

- Advertisement -