I am trying to insert images using "bulk" into SQL Server 2012. But, am ending up with the error message stating tha:
Msg 4834, Level 16, State 1, Line 2 You do not have permission to use the bulk load statement.
I have "sysadmin" access.
I am trying to insert images using "bulk" into SQL Server 2012. But, am ending up with the error message stating tha:
Msg 4834, Level 16, State 1, Line 2 You do not have permission to use the bulk load statement.
I have "sysadmin" access.
5条答案
按热度按时间ix0qys7i1#
Try
GRANT ADMINISTER BULK OPERATIONS TO [server_login]
. It is a server level permission, not a database level. This has fixed a similar issue for me in that past (using OPENROWSET I believe).kcwpcxri2#
Try this:
50pmv0ei3#
Note that the accepted answer or either of these two solutions work for Windows only.
If you run any of them on SQL Server based on a linux machine, you will get these errors:
Check the docs.
Requires INSERT and ADMINISTER BULK OPERATIONS permissions. In Azure SQL Database, INSERT and ADMINISTER DATABASE BULK OPERATIONS permissions are required. ADMINISTER BULK OPERATIONS permissions or the bulkadmin role is not supported for SQL Server on Linux. Only the sysadmin can perform bulk inserts for SQL Server on Linux.
Solution for Linux
p5cysglq4#
If you get an error saying "Cannot Bulk load file because you don't have access right"
First make sure the path and file name you have given are correct.
then try giving the bulkadmin role to the user. To do so follow the steps :- In Object Explorer -> Security -> Logins -> Select the user (right click) -> Properties -> Server Roles -> check the bulkadmin checkbox -> OK.
This worked for me.
brccelvz5#
SQL Server may also return this error if the service account does not have permission to read the file being imported. Ensure that the service account has read access to the file location. For example:
icacls D:\ImportFiles /Grant "NT Service\MSSQLServer":(OI)(CI)R