简体   繁体   English

由于无法打开文件,因此无法批量加载。 操作系统错误代码5

[英]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(访问被拒绝。)。

对于您正在运行此SQL语句的任何上下文(例如,在SSMS中),请尝试以admin身份打开应用程序

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.

相关问题 无法批量加载,因为文件“ \\\\” <UC Path> \\\\ Test.csv”无法打开。 操作系统错误代码1240 - Cannot bulk load because the file “\\<UC Path>\\Test.csv” could not be opened. Operating system error code 1240 Azure blob 到 Azure SQL 数据库:无法批量加载,因为无法打开文件“xxxx.csv”。 操作系统错误代码 5(访问被拒绝。) - Azure blob to Azure SQL Database: Cannot bulk load because the file "xxxx.csv" could not be opened. Operating system error code 5(Access is denied.) 由于文件(类型不匹配或指定代码的字符无效),无法批量加载 - Cannot bulk load because the file(type mismatch or invalid character for the specified code) 无法读取C:\\ Temp \\ PetSales.fmt。 操作系统错误代码(null) - C:\Temp\PetSales.fmt could not be read. Operating system error code (null) .mdf”失败,出现操作系统错误 2(系统找不到指定的文件。) - .mdf" failed with the operating system error 2(The system cannot find the file specified.) 文件的目录查找失败,出现操作系统错误 3(系统找不到指定的路径。) - Directory lookup for the file failed with the operating system error 3 (The system cannot find the path specified.) 将数据库文件导入Visual Studio 2017会出现错误“由于其版本869而无法打开” - Importing database file into visual studio 2017 gives an error “cannot be opened because its version 869” 消息 5123,级别 16,状态 1,第 8 行 CREATE FILE 语句遇到操作系统错误 2(系统找不到指定的文件。) - Msg 5123, Level 16, State 1, Line 8 The CREATE FILE statement encountered operating system error 2 (The system cannot find the specified file.) Adventure Works无法批量加载错误 - Adventure Works Cannot Bulk load Error Netbeans中出现“无法批量加载”错误。 - “Cannot Bulk Load” Error in Netbeans.
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM