title: bulk insert returning error, "the file could not be opened"
body: <p>I am running the following query in SQL Server 11.0. </p>
  
  <pre><code>BULK INSERT [dbo].[Andy] FROM "Y:\users\joe\APP data main file.csv"
                WITH (FIRSTROW = 2, FIELDTERMINATOR = ',' ,
                ROWTERMINATOR = '\n', TABLOCK)
  </code></pre>
  
  <p>The command is returning the error, </p>
  
  <blockquote>
    <p>Cannot bulk load because the file "Y:\users\joe\APP data main
    file.csv" could not be opened. Operating system error code 3(The
    system cannot find the path specified.).</p>
  </blockquote>
  
  <p>The cause of this error, from researching it online, is that the Bulk Insert task runs by executing the Bulk Insert command from the target SQL server to load the file. This means that the SQL Server Agent of the target SQL server should have permissions on the file I am trying to load. <strong>How can I find out whether it does or not?</strong> </p>
  
  <p>Secondly, according to Microsoft’s website, “…if a SQL Server user logs on by using Windows Authentication, the user can read only those files that can be accessed by the user account, regardless of the security profile of the SQL Server process.”</p>
  
  <p>I log onto SQL Server using Windows Authentication. By the definition on the MS website, I have access to the file I am trying to insert from. I created it, and I can open it. More specifically, the Windows account I’ve logged onto (my own) is the account that created the csv file, and is the account through which I open SQL Server. Yet the error is there. There is something I am missing, but I have no idea what it is.</p>
  
  <p>Finally, it doesn’t matter whether or not I use the UNC path to access the file, or the drive mapping.</p>