December 23, 2010 at 6:05 pm
Hello
when we Try to attach the DB files, i can add the first primary datafile(ABC.mdf). when i try to add the next datafile(ABC_1.mdf). It gives me the following error.
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
M:\ABCDATA2\ABC_1.mdf is not a primary database file. (Microsoft SQL Server, Error: 5171)
Can some one provide me the solution.
thanks
December 23, 2010 at 11:59 pm
http://msdn.microsoft.com/en-us/library/ms188902.aspx
investigate the files in you backup....use the link above..
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle
December 24, 2010 at 2:06 am
Henrico Bekker (12/23/2010)
http://msdn.microsoft.com/en-us/library/ms188902.aspxinvestigate the files in you backup....use the link above..
There's no backup here. He's attaching, not restoring.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 24, 2010 at 2:09 am
What files are supposed to be part of this database?
When you use the dialog to attach a DB, SQL goes and finds the secondary and log files for you, based on what's in the DB header. You shouldn't need to add files, maybe just change the locations.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 24, 2010 at 3:03 am
sometmes the .bak file will be corrupted...try attaching another .bak file
December 24, 2010 at 3:10 am
For database attachment you map all data and log files in one screen.
Each db has at least one primary data files, and might have secondary data files.
When you select the primary data file, the wizard will find the secondary and log files.
So, perhaps you are trying to attach a secondary data file without selecting the primary first.
Please check How to Attach Database in SQL Server 2011 and How to Attach Database in SQL Server 2008
I hope that helps,
December 24, 2010 at 4:45 am
abhishek.8604 (12/24/2010)
sometmes the .bak file will be corrupted...try attaching another .bak file
There's no backup here. He's attaching, not restoring.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply