You do not have permission to use the bulk load statement
Asked Answered
E

4

28

Hi I'm getting the error

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

when I try to execute a stored procedure.

I've seen some websites mentioning about the bulkadmin role, but I don't see it.

I'm using SQL Server 2008.

Any ideas?

Escape answered 21/10, 2012 at 21:47 Comment(1)
Sorry didn't see the it coming up first time!Escape
C
56
  • Start SQL Server Managament Studio
  • Expand Security->Logins
  • Locate your user, right click on it and take Properties
  • Open Server Roles tab
  • Make sure that bulkadmin is checked.
  • There you can experiment with other roles if bulkadmin doesn't work for you.
  • Click OK :)
Cahra answered 21/10, 2012 at 22:13 Comment(2)
in case some didn't find the bulkadmin role like me, you probably went to SQL SMS - > Databases -> Security -> Logins , instead of SQL SMS - > Security -> Logins (as it applies for user to entire server not just one database)Wharfage
I have the same problem. Bulkadmin server role assignment is not helped for me. Do you have any other suggestion?Cumulation
W
6

Query version for Aleksandr's answer:

EXEC master..sp_addsrvrolemember @loginame = N'%userName%', @rolename = N'bulkadmin'
GO

Just replace %userName% with desired user. Also you need to be loged in as Sys-Admin (sa) or other user with EXEC permissions and bulkadmin granting permission.

Wharfage answered 5/6, 2013 at 9:37 Comment(0)
V
0

You can provide permission to user to fix this issue.

  1. Go to MS SQL server management and connect to db.
  2. In Object Explorer, go to Security and then login.
  3. Look for your user and right click on it.
  4. "Login Properties" popup will open
  5. Click on "Server Roles" and check "bulkadmin". Now if you try to execute again you must not get the error.

Source: http://sforsuresh.in/asp-net-mvc-4-not-permission-use-bulk-load-statement

Vineland answered 20/1, 2021 at 7:9 Comment(0)
E
-1

I was having the same issue on a Sql Serverless database (Azure Synapse Analytics).

sp_addsrvrolemember is not available in this context, so I used the following to solve the issue:

ALTER ROLE db_owner ADD MEMBER [username]; -- owner allows bulk operations
ALTER ROLE db_denydatawriter ADD MEMBER [username]; -- in our case we don't want this specific user to have writer

It doesn't feel quite right to give owner to this user. Thoughts anyone?

Ebner answered 31/8, 2022 at 9:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.