title: How do I grant access to SQL Server Agent to be able to write/modify system files?
body: <p>I have a job that has a stored procedure that runs BCP to QUERYOUT some data.</p>
  
  <p>If I run the QUERYOUT command by itself, it works.</p>
  
  <p>However, if I try to run it in a JOB, it creates the file but "hangs" and the data is never put in the file. This hangs forever so I usually terminate the BCP.exe.</p>
  
  <p>My question is:</p>
  
  <p>How do I get a SQL job to run BCP to do a QUERYOUT and have the permissions to do so?</p>
  
  <p>The QUERYOUT is going to the C:\ drive (so nothing fancy or anything).</p>
  
  <p>This problem is driving me nuts and from reading online, it looks like the user that runs the jobs needs permissions to the folder. The folder isn't protected or anything.</p>
  
  <p>The owner of the SQL job is part of the SYS ADMIN group in SQL.</p>
  
  <p>Any help would be greatly appreciated.</p>