How to enable bulk permission in SQL Server

前端 未结 6 1231
我在风中等你
我在风中等你 2020-11-30 05:52

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, L

相关标签:
6条回答
  • 2020-11-30 05:56

    Try this:

    USE master;
    
    GO;
     
    GRANT ADMINISTER BULK OPERATIONS TO shira;
    
    0 讨论(0)
  • 2020-11-30 06:02

    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.

    0 讨论(0)
  • 2020-11-30 06:03

    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

    0 讨论(0)
  • 2020-11-30 06:08

    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).

    0 讨论(0)
  • 2020-11-30 06:14

    USE Master GO

    ALTER Server Role [bulkadmin] ADD MEMBER [username] GO Command failed even tried several command parameters

    master..sp_addsrvrolemember @loginame = N'username', @rolename = N'bulkadmin' GO Command was successful..

    0 讨论(0)
  • 2020-11-30 06:16

    Note that the accepted answer or either of these two solutions work for Windows only.

    GRANT ADMINISTER BULK OPERATIONS TO [login_name];
    -- OR
    ALTER SERVER ROLE [bulkadmin] ADD MEMBER [login_name];
    

    If you run any of them on SQL Server based on a linux machine, you will get these errors:

    Msg 16202, Level 15, State 1, Line 1
    Keyword or statement option 'bulkadmin' is not supported on the 'Linux' platform.
    
    Msg 16202, Level 15, State 3, Line 1
    Keyword or statement option 'ADMINISTER BULK OPERATIONS' is not supported on the 'Linux' platform.
    

    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

    ALTER SERVER ROLE [sysadmin] ADD MEMBER [login_name];
    
    0 讨论(0)
提交回复
热议问题