title: BULK INSERT returns error "Access is denied"
body: <p>When running Bulk Insert </p>
  
  <pre><code>BULK INSERT MyDatabase.dbo.MyTable 
  FROM '\\Mylaptop\UniversalShare\SQLRuleOutput.csv' 
  WITH (FIRSTROW = 2, FIELDTERMINATOR = ',', ROWTERMINATOR = '\n')
  </code></pre>
  
  <p>on a remote SQL Server I get this error:</p>
  
  <blockquote>
    <p>"Cannot bulk load because the file
    "\MyLaptop\UniversalShare\SQLRuleOutput.csv" could not be opened.
    Operating system error code 5(Access is denied.)."</p>
  </blockquote>
  
  <ul>
  <li>The share is open to all.  </li>
  <li>I have run PowerShell <code>Invoke-SQLCMD</code> scripts on that SQL Server that where it connects to that same share, so the server can see the share.</li>
  <li>This <code>Bulk Insert</code> statement fails with the same error whether I run it directly as T-SQL on the SQL Server, or through PowerShell <code>Invoke-SQLCMD</code> (which is my intended method).</li>
  </ul>
  
  <p>This question is similar, <a href="https://stackoverflow.com/questions/14555262/cannot-bulk-load-operating-system-error-code-5-access-is-denied">Cannot bulk load. Operating system error code 5 (Access is denied.)</a>, but in my case the share is open to all, so permissions <em>shouldn't</em> be an issue, and the share is definitely in a different place (my laptop for POC development) than SQL Server.</p>
  
  <p>Does anyone know why this error is happening, or how to get around it?</p>
  
  <p>Thanks,</p>
  
  <p>Conrad</p>