将mdf文件附加到SQL Server 2008 Express Edition [英] Attach mdf file to sql server 2008 express edition

查看:162
本文介绍了将mdf文件附加到SQL Server 2008 Express Edition的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我通过sql server 2008专业版生成了mdf文件.
此后,我想将其附加到sql server 2008 Express Edition,
但没有附上.

sql express有以下错误:


无法为此请求检索数据. (Microsoft.SqlServer.Management.Sdk.Sfc)
要获取帮助,请单击:http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476
------------------------------
其他信息:
执行Transact-SQL语句或批处理时发生异常. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
尝试打开或创建物理文件路径文件"时,CREATE FILE遇到操作系统错误5(未能为此错误检索文本.原因:1815). (Microsoft SQL Server,错误:5123)
要获得帮助,请单击:http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.00.1600&EvtSrc=MSSQLServer&EvtID=5123&LinkId=20476



请帮帮我
TNX

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: 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(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: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.00.1600&EvtSrc=MSSQLServer&EvtID=5123&LinkId=20476



plz, help me
TNX

推荐答案

在底部查看解决方案部分: ^ ]

首先使用Google,您会为所发现的东西感到惊讶.祝你好运!
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!


谢谢

我找到以下解决方案:

1.从SQL Server \ close Management Studio(所有实例)退出.

2.右键单击通常在其中安装SQL Server的驱动器C:或保存.mdf和.ldf文件的驱动器.例如,C:\ Program Files \ Microsoft SQL Server \ MSSQL.1 \ MSSQL \ Data是默认数据库的默认位置.

3.右键单击C :,然后单击属性.

4.在属性"对话框中,选择安全性"选项卡. (如果像往常一样不显示安全性"选项卡,则首先删除使用简单共享"选项,有关步骤,请参阅下文).

5.在选择组或用户名"框中,查看是否列出您的SQL登录名.例如,如果将Myserver \ sa用作SQL Server身份验证模式,则Myserve \ sa应列在此框中.如果不是,则添加名称.

6.单击添加按钮.输入用于登录SQL Server的名称,例如sa.

7.单击检查名称"以验证您指定的名称确实以SQL Server用户身份存在.如果不是,请在选择组或用户名"框中单击高级".

8.单击位置"按钮,然后选择您的SQL Server名称.单击立即查找.框中列出了SQL Server的所有用户.

9.选择用户,最好是您的SQL Server身份验证帐户.单击确定.

10.在组或用户名"框中,选择在上一步中选择的用户名,并授予该用户完全控制权限.单击确定.
通过使用SQL Server身份验证,您都可以连接,分离数据库.打开Management Studio并执行附加或分离操作将没有问题.


查看安全性标签:
1.打开我的电脑.
2.单击工具,然后选择查看选项卡.
3.在高级设置"框中,向下滚动至底部,然后清除名为使用简单文件共享"(推荐)的复选框.
4.单击确定.
您将可以在任何地方查看安全性"选项卡.

资源: http://social.msdn.microsoft.com/论坛/en/sqlgetstarted/thread/03e12388-01f2-4ae7-aab9-14e27a9ef0b3 [
Thanks

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.

resource: http://social.msdn.microsoft.com/Forums/en/sqlgetstarted/thread/03e12388-01f2-4ae7-aab9-14e27a9ef0b3[^]


这篇关于将mdf文件附加到SQL Server 2008 Express Edition的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆