I tried the following code to try and bulk load into a table in my SQL Server.

BULK INSERT dbo.CentralRepository_Associate_Details 
FROM '/1CAAP/1413/data/csvtest1.csv' WITH (FIELDTERMINATOR = ';') 

and got the following error :

Cannot bulk load because the file "/1CAAP/1413/data/csvtest1.csv" 
could not be opened.     
Operating system error code 3(failed to retrieve text for this error. Reason: 15105).

I guess error code 3 is a permission error.

Just a request: I'm not very good as far as stuff like this is concerned. So explanation in layman terms would be really helpful.

migrated from stackoverflow.com Jun 5 '14 at 9:56

This question came from our site for professional and enthusiast programmers.

  • First of all the path should be as Ilya explained in windows path format i.e C:\Files\FileName.CSV and you are also missing the ROWTERMINATOR clause of your bulk insert. – M.Ali Jun 5 '14 at 8:51
  • Hi Thanks, I need to run the file from the server. So is there anyway I can do it using bulk insert? or is there another alternative to do the same. – user3455309 Jun 5 '14 at 9:25
  • Is this file located on your network share? If this is the case you can still use the UNC Path \\ServerName\Folder\FileName.CSV , Just make use Your login has permissions on that Network Share. and correct your synatx for bulk insert, as you are missing ROWTERMINATOR clause of your bulk insert statement. – M.Ali Jun 5 '14 at 9:31
  • Hi, My login does have permission and will look into the row terminator clause. Thanks. – user3455309 Jun 5 '14 at 9:45

http://msdn.microsoft.com/en-gb/library/windows/desktop/ms681382.aspx

ERROR_PATH_NOT_FOUND
  3 (0x3)
  The system cannot find the path specified.

Try the Windows path format, C:\1CAAP\1413\data\csvtest1.csv, instead of *nix. Does the file even exist at that path?

Edit: Run xp_fileexist '/1CAAP/1413/data/csvtest1.csv'

  • Yes the file does exist. – user3455309 Jun 5 '14 at 9:12
  • Hi Thanks, The thing is we are using unix servers to run the job. And it's throwing this error. Plus unix does not support windows path I presume? So is there any other alternative that is available to move the bulk data to the table? – user3455309 Jun 5 '14 at 9:18
  • How are you running SQL Server on a unix box? The cron job or what have you issuing the command might run on *nix, but the path needs to be understood by SQL Server, which I presume runs on Windows, no? – Ilya Kozhevnikov Jun 5 '14 at 9:22
  • Try running xp_fileexist '/1CAAP/1413/data/csvtest1.csv' on that server, what does it say? – Ilya Kozhevnikov Jun 5 '14 at 9:32
  • Ok, that was way too technical. anyway I'll tell you what I do. I have a job in pentaho that runs a script. I place that job on my server and then run the job in putty. xp_fileexist throws the same error. – user3455309 Jun 5 '14 at 9:45

Looks like the service account which you are you using in the job, does not have access to the file path. This could be because of the lack of trust between the two domains - the one which hosts the UNIX server and the one where your file resides. I guess the solution is to setup a service account which has pass through (between domains) authentication access.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.