Click here to Skip to main content
15,921,774 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have an issue. I have database MS SQL 2005 but I need to attach the mssql 2005 database into mssql 2012 server. I could not. please help me how to do this. Because Mssql 2005 database has lots of data inside. Pleas help me how to do so.

Below is the error
TITLE: Microsoft SQL Server Management Studio
Attach database failed for Server 'SILS-PC'.  (Microsoft.SqlServer.Smo)
For help, click:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
Unable to open the physical file "D:\HCKCMS\database2012\CMSHCK.mdf". Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120)
For help, click:
Updated 3-Oct-13 3:09am
Kornfeld Eliyahu Peter 3-Oct-13 8:57am    
"Access is denied"

You try to attach a mdf file that alrady attache inside sql 2005?
Check your permissions on D:\HCKCMS\database2012\CMSHCK.mdf...
Do linked server...
CHill60 3-Oct-13 8:57am    
Tejas Vaishnav 3-Oct-13 9:11am    
i think the issue is related to rights for the user which is trying to attaching the file to sql server. so can you please check it out it first. or it might solve your problem also.
Maideen Abdul Kader 11-Oct-13 23:21pm    
yes you are right. the permission issue
thank you

1 solution

Be aware that if you attach your 2005 DB to SQL2012 you will not be able to use it with SQL 2005 again - Sql will convert it to the latest format, and there is no facility to export a 2005 friendly version.

A much, much better idea would be to copy the DB and allow the 2012 version to be a new, separate DB that it manages:[^]
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