[英]Cannot bulk load because the file could not be opened. Operating System Error Code 5
I'm trying to insert an image into SQL Server using this SQL query 我正在尝试使用此SQL查询将图像插入SQL Server
INSERT INTO dbo.Employees(ImageColumn)
SELECT BulkColumn
FROM OPENROWSET(BULK 'C:\Users\ahmed\Desktop\employee.jpg', Single_Blob) AS img
but I'm getting this message: 但我收到此消息:
Msg 4861, Level 16, State 1, Line 3 Msg 4861,第16级,状态1,第3行
Cannot bulk load because the file "C:\\Users\\ahmed\\Desktop\\employee.jpg" could not be opened. 由于无法打开文件“ C:\\ Users \\ ahmed \\ Desktop \\ employee.jpg”,因此无法批量加载。 Operating system error code 5 (Access is denied.). 操作系统错误代码5(访问被拒绝。)。
Try logging in to SSMS under the sa account and try that. 尝试使用sa帐户登录到SSMS,然后尝试执行该操作。 I have a lot of permissions issues when I'm logged in as myself, even if I'm logged in with admin privileges. 以我自己的身份登录时,即使使用管理员权限登录,我也会遇到很多权限问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.