Hi I have a stored procedure which imports from a csv file and saves to a temporary table. The procedure runs fine when I run "exec myProc" but when I put the same "exec myProc" into a SQL Agent job I get an error. Executed as user: NT AUTHORITY\NETWORK SERVICE. Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)"
I have also tried running job as a windows user who is member of local administrators group. I get same error except the user name is different in error message.
The folder containing the file is a shared folder and the local user and network service user have full permissions on the folder and on the share.
I've tried two different methods Bulk Insert and openrowset. I have also removed the saving to temp table where I just read the first few lines of the csv file but still get same error. Here is the way I read from csv file:
Hi, yes the folder is local to the server. The path is C:\myFolder where "myFolder" is windows folder name and the share name. As I mentioned above executing the procedure works but not from within agent