I have a user who is trying to do a Bulk Insert on a database using a Python script and get´s the error - Cannot bulk load because the file "//server.local.com/File01/In Progress/Work/Script/file.csv" could not be opened. Operating system error code 5(Access is denied.)
Now I am no SQL expert or even an Admin, my knowlegde of SQL is very limited, so I hope someone who has far more knowledge and experience than I do can shed some light on what I can do to help this user.
Details:
- SQL Cluster - both SQL Servers are running on Windows Server 2012 R2 with SQL Server 2012
Using SQL Server Management Studio:
- User Domain account (Domain\Fred) is listed in the Security -> Logins on the SQL Cluster
- Properties of Domain\Fred - Server Roles: bulkadmin & public are both checked
- Properties of Domain\Fred - User Mapping - Domain User account is mapped to the Database: Firm1 and the default schema is dbo. * Properties of Domain\Fred - User Mapping - Database role membership for Firm1: db_datawriter; db_owner; and public checked
Python Script:
BULK INSERT Firm1.dbo.pyFILE FROM '//server.local.com/File01/In Progress/Work/Script/file.csv' WITH (FIELDTERMINATOR='\
\t', ROWTERMINATOR='\n')
Error:
ProgrammingError: ('42000', '[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot bulk load because the file "//server.local.com/File01/In Progress/Work/Script/file.csv" could not be opened. Operating system error code 5(Access is denied.).')
Error message in SQL Server Manager:
Msg 4861, Level 16, State 1, Line 3
Cannot bulk load because the file "//server.local.com/File01/In Progress/Work/Script/file.csv" could not be opened. Operating system error code 5(Access is denied.).
The SQL Cluster has access to the UNC: //server.local.com/File01/In Progress/Work/Script/
SPNS have been set for Service Accounts for both SQL Servers which are part of the SQL Cluster.
Any tips or what I should try next would be greatly appreciated.
Steve