BULK INSERT fails because of an access denial, despite having read permissions granted to the directory

Viewed 23

The SQL Server is log on as a domain user. It has read and read & execute permissions granted to the specific network directory (let's say \\path_to_network_directory\), which I have checked in two ways:

  1. By mapping a network drive with user's credentials. It allowed me to enter the directory and read all files as I expected.
  2. By restoring a database backup from the directory.

At this point I am quite sure that SQL Sever has access to the directory. Although I cannot bulk insert from a file that is located there.

But when I execute this

BULK INSERT TEST_TABLE
FROM '\\path_to_network_directory\bulkinsert_test.txt'
WITH (
    ROWTERMINATOR = '\n',
    FIELDTERMINATOR = ','
)

I get an error like this

Cannot bulk load because the file "\path_to_network_directory\bulkinsert_test.txt" could not be opened. Operating system error code 5 (Access is denied.).

Is this the problem with permissions or am I messing something with BULK INSERT?


Btw, in this case I cannot place the file at the computer where SQL Server is installed.

0 Answers
Related