gpt4 book ai didi

sql - sp_attach_single_file_db 错误 : failed with the operating system error 5(Access is denied.)

转载 作者:行者123 更新时间:2023-12-03 18:10:14 24 4
gpt4 key购买 nike

我正在尝试使用来自 MS 的此示例项目附带的此数据库:

http://code.msdn.microsoft.com/ASPNET-Web-Forms-6c7197aa/sourcecode?fileId=18930&pathId=365206059

所以在我下载文件后:我需要将 .mdf 数据库附加到我的 MS SQL 2008 实例。

从 Management Studio 附加数据库不起作用,使用此命令的事件我收到相同的错误:

sp_attach_single_file_db 'School.mdf', 'C:\School.mdf'



错误:
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "C:\School.mdf" failed with the operating system error 5(Access is denied.).

知道出了什么问题吗?谢谢你的帮助!

最佳答案

对要在其中创建 mdf 文件的文件夹授予完全权限
到运行 SQL Server 服务的登录帐户。
通常:NT Service\MSSQL$

你可以查一下
控制面板-> 管理工具-> 服务=> SQL Server -> 属性-> 登录选项卡-> 记下帐户

关于sql - sp_attach_single_file_db 错误 : failed with the operating system error 5(Access is denied.),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6703368/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com