我正在尝试在 SQL Express 中恢复 .BAK 文件之前执行此 SQL 查询.最初,我在用户帐户的桌面上有该文件.我以管理员身份登录.
I am trying to execute this SQL query prior to restoring a .BAK file in SQL Express. Initially, I had the file on the Desktop of my user account. I am logged in as Administrator.
当我尝试像这样访问桌面上的 .BAK 文件时
When I try to access the .BAK file on the desktop like this
RESTORE FILELISTONLY FROM DISK= 'C:\Documents and Settings\Administrator\Desktop\file.bak'
出现错误.
Msg 3201, Level 16, State 2, Line 1
Cannot open backup device 'C:\Documents and Settings\Administrator\Desktop\file.bak'. Operating system error 5(Access is denied.).
Msg 3013, Level 16, State 1, Line 1
RESTORE FILELIST is terminating abnormally.
但是,当我将 .BAK 文件移动到 C:\temp 并执行此
However, when I move the .BAK file to C:\temp, and execute this
RESTORE FILELISTONLY FROM DISK= 'C:\temp\file.bak'
效果很好.
我无法弄清楚发生了什么.有没有办法通过 SQL Express 使用 Windows 身份验证访问桌面上的文件?
I cant figure out what is going on. Is there a way to access files on Desktop using Windows Authentication with SQL Express?
尝试授予 Users 或 LOCAL SERVICE 对文件夹 C:\Documents and Settings\ 的读取权限策略编辑器中的 Administrator\Desktop\(右键单击该文件夹,然后在安全"选项卡中单击添加...",然后单击高级..."|立即查找
Try granting read permission to Users or LOCAL SERVICE to the folder C:\Documents and Settings\Administrator\Desktop\ in your Policy Editor (right click the folder and in the Security tab click Add... then Advanced...|Find Now
这篇关于为什么我无法在 Windows 身份验证模式下使用 SQL Express 从桌面上的 .BAK 文件中读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
我应该使用什么 SQL Server 数据类型来存储字节 What SQL Server Datatype Should I Use To Store A Byte[](我应该使用什么 SQL Server 数据类型来存储字节 [])
解释 SQL Server 中 sys.objects 中的类型代码Interpreting type codes in sys.objects in SQL Server(解释 SQL Server 中 sys.objects 中的类型代码)
Typeorm .loadRelationCountAndMap 返回零Typeorm .loadRelationCountAndMap returns zeros(Typeorm .loadRelationCountAndMap 返回零)
MS SQL:ISDATE() 是否应该返回“1"?什么时候不能MS SQL: Should ISDATE() Return quot;1quot; when Cannot Cast as Date?(MS SQL:ISDATE() 是否应该返回“1?什么时候不能投射为日期?)
将一天的名称转换为其整数表示Converting the name of a day to its integer representation(将一天的名称转换为其整数表示)
如何在 SQL Server 中将 nvarchar m/d/yy 转换为 mm/dd/yHow to convert nvarchar m/d/yy to mm/dd/yyyy in SQL Server?(如何在 SQL Server 中将 nvarchar m/d/yy 转换为 mm/dd/yyyy?)