title: Openrowset bulk file access denied
body: <p>I'm having issues executing an openrowset from a UNC path, receiving the error:</p>
  
  <blockquote>
    <p>Cannot bulk load because the file "\\computer2\path\file.xml" could not be opened. Operating system error code 5(Access is denied.).</p>
  </blockquote>
  
  <p>For reference, the specific t-sql code is:</p>
  
  <pre><code>select full_xml from openrowset(bulk '\\computer2\path\file.xml', Single_BLOB) as T(full_xml)
  </code></pre>
  
  <p>I'm using Sql Logins, with a gMSA running the service.  The gMSA has full read/write access to the UNC path (backups going to the same UNC path work just fine).  I can also copy file.xml to a local path, and the openrowset works as expected.</p>
  
  <p><strong>EDIT:</strong>
  I am not using a Sql Login for the connection to the db.  I'm using a Windows domain account, which also has full access to the UNC path.  Following @lptr's suggestion (in comments/chat), when I connect using a Sql Login, everything works as expected.  I'm still getting the same error when connecting using my domain account.</p>