Sql-server – SQL Server Bulk insert over UNC path failing, despite full access

sql serversql-server-2016

I have a setup with 2 machines (client on win2012r2, sql server on win2016) which are both not part of a domain. The client machine has a share, accessible to Everyone. I'm using SQL Server authentication. I'm able to browse the share from the SQL server

I have an application which attempt to do a BULK INSERT, but it's complaining that the bulk insert encountered an error code 1326 (username or password incorrect) when accessing the share.

This does not make sense to me; there is no password required to access the files, so how can it be incorrect? I've also tried to configure the application to upload to a share on the SQL Server, and do the bulk insert using a local path, but that triggers an access denied during the BULK INSERT.

Best Answer

What Sean and Tim said in their comments. If your SQL Server, which I'll call SQLServer2016, is running as local system, it's accessing the share as the machine account, which I'll call $SQLServer2016.

Your share is available to EVERYONE. EVERYONE is a built-in group that includes Authenticated Users (another built-in group that includes everyone with an account on that machine) and Guest. Guest is a built-in account for people who don't have an account on the machine that houses your share, which I'll call Fileserver2012R2.

SQLServer2016's system account, $SQLServer2016, is, by definition, not a valid Fileserver2012R2 account. SQLServer2016 would access the share on Fileserver2012R2 via the Guest account.

My guess would be that Guest is disabled on Fileserver2012R2.

Related Topic