Click here to Skip to main content
15,996,848 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have the Test.mdf & Test.ldf files in my particular location(D:\DBFolder)

But when I attach that Test.mdf file by attach option then a error msg shown('Attach database failed for Server 'MachineName\SQLEXPRESS'.
(Microsoft.SqlServer.Express.Smo)')

my database userID = sa
my database Password = sa
The Database Service ('SQL Server (SQLEXPRESS)') logon is 'NT AUTHORITY\NETWORKSERVICE'

My OS is XP serpack 2 & No set password & OS System UserName is 'Machine\User'

How will i solve above problem?????
Please Please help me any instruction.......
Posted

there could be no. of reasons for failure of database attachment
Like
1. mdf file is made in upgrated virsion than your sql server's version
   e.g. database was created in 2008 and you are trying to attach in sql-2005
2. Login 'sa' have not enough rights/permissions to perform database attachment.
3. this Name is already exist in history of database names.


etc...

please describe error details if it is possible.

Happy Coding!
:)
 
Share this answer
 
Comments
_Amy 9-Aug-12 6:41am    
Hmm. Nice answer +5!
Aarti Meswania 9-Aug-12 6:42am    
thank you! :)
first you need to stop the server then attach the files.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900