Skip to main content
2 of 4
edited tags
Hannah Vernon
  • 70.5k
  • 22
  • 177
  • 321

SQL Bulk Insert Impersonation issue

I am running Microsoft SQL 2012 SP on a Windows Server 2008 R2 Standard SP1 box. The SQL service is running as a simple windows domain user (nothing special, no admin rights, etc.)

I am having some issues with using Bulk Insert when the data file is on a network share when using Windows Authentication. What is known is that the SQL service account has access to the network resource, which is shown by logging into SQL with a SQL account and doing the Bulk Insert. I also have rights to the files on the share, as shown by the fact that I put the files there.

Now, when connecting to SQL with Windows Authentication and running the Bulk Insert I get the following error (emphasis mine):

Msg 4861, Level 16, State 1, Line 2 Cannot bulk load because the file "\\[server]\[share]\[filename]" could not be opened. Operating system error code 5(Access is denied.).

I found this snip at BULK INSERT (Transact-SQL)\Security Account Delegation (Impersonation), which says, in part:

To resolve this error [4861], use SQL Server Authentication and specify a SQL Server login that uses the security profile of the SQL Server process account, or configure Windows to enable security account delegation. For information about how to enable a user account to be trusted for delegation, see Windows Help.

Finally, after much searching, I found this TechNet article, How to Configure the Server to be Trusted for Delegation, and we tried the unconstrained delegation and I rebooted the SQL server, but it still does not work.

What the heck am I missing???

Jim
  • 245
  • 3
  • 10