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
 SQL Server Administration (2008)
 Attach database error

Author  Topic 

sasan_vm
Yak Posting Veteran

51 Posts

Posted - 2011-10-21 : 13:29:17
Hello,

I want to attach sql 2000 database to sql 2008 r2 but got this error:

TITLE: Microsoft SQL Server Management Studio
------------------------------

Attach database failed for Server 'MANSOUR-HP'. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1539+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476

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

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

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

Unable to open the physical file "E:\_DATA_\DATA\TRANSPORT_Data.MDF". Operating system error 5: "5(failed to retrieve text for this error. Reason: 15105)". (Microsoft SQL Server, Error: 5120)

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

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

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


Why this happend ?

Regards,
sasan.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-10-21 : 13:44:02
When you copied the mdf/ldf files, was either the database detached first or the SQL Server service stopped?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sasan_vm
Yak Posting Veteran

51 Posts

Posted - 2011-10-21 : 13:58:57
Hello,

I stop sql service, not detached databse.
That is problem ?
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-10-21 : 14:27:24
OS error 5 is permission denied. SQL does not have full control over the folder and files. Fix that and try again.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

sasan_vm
Yak Posting Veteran

51 Posts

Posted - 2011-10-21 : 15:17:38
Thank you, with allow permission to sql service problem solved.
Go to Top of Page

Cindyaz
Yak Posting Veteran

73 Posts

Posted - 2011-10-22 : 17:04:19
You might get this error in RTM version. Right click on SQL Server Management Studio, and click on Run As Administrator. Then attach the file.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-10-22 : 18:34:03
quote:
Originally posted by Cindyaz

You might get this error in RTM version. Right click on SQL Server Management Studio, and click on Run As Administrator. Then attach the file.




OP indicated it's already working, no need to do these steps.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Cindyaz
Yak Posting Veteran

73 Posts

Posted - 2011-10-23 : 03:25:47
right. i overlooked that post.
Go to Top of Page
   

- Advertisement -