4

User is getting below error while running bulk insert command in Azure SQL Server. I am using Azure SQL Server and not SQL Sever. Most of the commands related to Bulk Insert grant permission is not working in Azure SQL Server.

Error

You do not have permission to use the bulk load statement.

Commands Tried in Azure SQL Server to Add User

EXEC sp_addrolemember 'db_ddladmin', 'testuser'; 

ALTER SERVER ROLE [bulkadmin] ADD MEMBER testuser

GRANT ADMINISTER BULK OPERATIONS TO testuser

Error

Msg 40520, Level 16, State 1, Line 5
Securable class 'server' not supported in this version of SQL Server.

Your help is highly appreciated.

Jo.........
  • 190
  • 1
  • 3
  • 13

3 Answers3

15

In Azure SQL Database, grant ADMINISTER DATABASE BULK OPERATIONS to the principal in the context of the desire database:

GRANT ADMINISTER DATABASE BULK OPERATIONS TO testuser;

The user will also need INSERT permissions on the target table. These Azure SQL Database permissions are detailed in the BULK INSERT documentation under the permissions section.

Dan Guzman
  • 43,250
  • 3
  • 46
  • 71
1

On Azure it works on tables in the database in question only. It does not work on temp tables. So if you are bulk loading in parallel and want to use temp tables, you are in a corner.

0
GRANT CONTROL to testuser 

nothing else is needed, just this to be executed in content DB (not master)

full steps

in Master

CREATE LOGIN login1 WITH password='1231!#ASDF!a';

in content DB

CREATE USER user1 FROM LOGIN login1;

GRANT CONTROL to user1; --(this is for bulk to work)
Blue Clouds
  • 7,295
  • 4
  • 71
  • 112