Click here to Skip to main content
15,668,923 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi I generated mdf file by sql server 2008 professional edition.
Thereafter i wanted to attach it to sql server 2008 express edition,
but it didn't attach.

sql express had below error:

Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)
For help, click:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
CREATE FILE encountered operating system error 5(failed to retrieve text for this error. Reason: 1815) while attempting to open or create the physical file 'Path file'. (Microsoft SQL Server, Error: 5123)
For help, click:

plz, help me
Updated 23-Nov-10 19:58pm

Check out the solution part at the bottom: Attach MDF File Issue[^]

Just Google it first, you will be amazed at what you find. Good luck!
Share this answer

I find below solution for it:

1.Exit from SQL Server \close Management Studio(all instances).

2.Right-click the drive in which SQL Server is installed usually C: or the drive where your .mdf and .ldf files are saved. For example, C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data the default location of the default databases.

3.Right-click C: and click Properties.

4.In the Properties dialog box, select the Security tab. (If security tab is not visible, as usual, then first remove the use simple sharing option, see below for steps).

5.In the Select Group or User Names box view that your SQL login is listed or not. For example, if you use Myserver\sa as the SQL server authentication mode then Myserve\sa should be listed in this box. If it is not then add the name.

6.Click the Add button. Enter the name you used to login to SQL Server for example sa.

7.Click Check Names to verify that the name you are specifying does exists as SQL Server user. If it is not, click Advanced in the Select Group or User Names box.

8.Click the Locations button and select your SQL Server name. Click Find Now. All users of the SQL Server are listed in the box.

9.Select the user, preferably your SQL Server authentication account. Click OK.

10.In the Group or User Names box, select the user name you selected in the above step and give full control permission to the user. Click OK.
You are all set to attach, detach, databases by using the SQL Server authentication. Open Management Studio and perform attach or detach there would be no problem.

Viewing the security tab:
1.Open My Computer.
2.Click Tools and select View tab.
3.In the Advanced Settings box, scroll down to bottom and clear the checkbox named Use simple file sharing (recommended).
4.Click OK.
You will be able to view Security tab everywhere.

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