title: Cannot bulk load. Operating system error code 5 (Access is denied.)
body: <p>For some weird reason I'm having problems executing a bulk insert.</p>
  <pre><code>BULK INSERT customer_stg
  FROM 'C:\Users\Michael\workspace\pydb\data\andrew.out.txt'
  WITH
  (
      FIRSTROW=0,
      FIELDTERMINATOR='\t',
      ROWTERMINATOR='\n'
  )
  </code></pre>
  <p>I'm confident after reading <a href="https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2005/ms189934(v=sql.90)" rel="noreferrer">this</a> that I've setup my user role correctly, as it states...</p>
  <blockquote>
  <p>Members of the bulkadmin fixed server role can run the BULK INSERT statement.</p>
  </blockquote>
  <p>I have set the <code>Login Properties</code> for the Windows Authentication correctly (as seen below).. to grant server-wide permissions on <code>bulkadmin</code></p>
  <p><a href="https://i.stack.imgur.com/7YSbQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7YSbQ.png" alt="windows authentication" /></a><br />
  <sub>(source: <a href="http://iforce.co.nz/i/daaqcasj.vo1.png" rel="noreferrer">iforce.co.nz</a>)</sub></p>
  <p>And the command <code>EXEC sp_helpsrvrolemember 'bulkadmin'</code> tells me that the information above was successful, and the current user <code>Michael-PC\Michael</code> has <code>bulkadmin</code> permissions.</p>
  <p><a href="https://i.stack.imgur.com/ADWKh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ADWKh.png" alt="bulkadmin" /></a><br />
  <sub>(source: <a href="http://iforce.co.nz/i/bou0uklk.wdj.png" rel="noreferrer">iforce.co.nz</a>)</sub></p>
  <p>But even though I've set everything up correctly as far as I know, I'm still getting the error. executing the bulk insert directly from SQL Server Management Studio.</p>
  <blockquote>
  <p><em>Msg 4861, Level 16, State 1, Line 2<br />
  Cannot bulk load because the file &quot;C:\Users\Michael\workspace\pydb\data\andrew.out.txt&quot; could not be opened. Operating system error code 5(Access is denied.).</em></p>
  </blockquote>
  <p>which doesn't make sense because apparently <code>bulkadmins</code> can run the statement, am I meant to reconfigure how the <code>bulkadmin</code> works? (I'm so lost). Any ideas on how to fix it?</p>