Click here to Skip to main content
15,891,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I got an error when attach a database.
I am used SQL Server 2008. After system format ,installed sql 2008.
Then I try to attach previously used database.Then got an error as :

And also I can't rename or move database file . Then shows ---"verify file is currently use"


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)

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

CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'D:\\DB\\DBFile_Data.MDF'. (Microsoft SQL Server, Error: 5123)

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

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

OK
------------------------------
Posted
Updated 12-Apr-17 1:24am
v2
Comments
OriginalGriff 14-Oct-11 3:46am    
And what happend when you followed the links in the error messages?

Did you backup the mdf & ldf both files?
and do you have the bakup file .bak for your database from earlier version.

previously I too faced issue while attaching the .mdf file from earlier version, and soon I used the bak file and it was done.
 
Share this answer
 
The solution is you have to make backup file ".bak" with your previous SQL version and then restoring it to SQL server 2008, there will help you to fix this problem.
 
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