• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6680
  • Last Modified:

SQL - You do not have permission to use the bulk load statement

Hi

I am trying to do a bulk insert into my SQL database.

BULK
INSERT tblAAA
FROM 'c:\temp\aaa.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO

However, when I try this I get 'You do not ahve permission to use the bulk load statement.

The database is on my local machine so I login using SQL authentication.

I select security - logins - name - right click and select properties and go to server roles. I have bulkadmin, sysadmin and public selected.

I am not sure what is going on here but it would be good to import my CSV file.

Any help is appreciated.

0
elmbrook
Asked:
elmbrook
1 Solution
 
jvejskrabCommented:
You must have rights for insert

USE yourdatabase
go
GRANT INSERT ON dbo.tblAAA  TO userName
go

Bulk Operations

USE master
go
GRANT ADMINISTER BULK OPERATIONS TO  userName

and Additionally for ALTER TABLE if at least one of the following is true:
Constraints exist and the CHECK_CONSTRAINTS option is not specified.
Triggers exist and the FIRE_TRIGGER option is not specified.

Also check if you have rights to the folder 'c:\temp\' (folder properties...security...read rights for sql user)

0
 
Anthony PerkinsCommented:
>>I have bulkadmin, sysadmin and public selected. <<
Are you sure the login you have used belongs to the sysadmin server role?

0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now