I am using SQL Server 2008 and I am getting an Access Denied error while trying to do a BULK INSERT which is accessing a network path, in the form: \\network_ip_address\Localdiskname$\filename_with_extenstion.
BULK
INSERT TableName
FROM '\\10.1.10.100\d$\Temp.csv'
How should I write the query correctly? How do I specify network authentication credentials such as username and password in the query?
A couple things here –
There may be a permissions issue on actually running the bulk insert command. Make sure that the account you are running the bulk insert operation from has the Fixed Server Role of bulkadmin or grant Administer Bulk Operations permissions which allows bulk insert operations to happen.
Also for the UNC path – You can’t specify network authentication credentials in the query. This is going to access that path as the service account that SQL is running under.
I would verify:
This article in SQL Server books online tells you all you need to know about bulk operations and has sections on permissions and network security.