February 17, 2014 at 3:08 am
Am using bulk insert to load csv file to table. But am failing getting the error
the file does not exist. Anyone can help urgently
February 17, 2014 at 3:12 am
Thanks for replying
bulk insert sample1
from 'D:\BEM_Source\Sample'
with
(
rowterminator = '',
fieldterminator= ','
)
February 17, 2014 at 3:20 am
Does a file named "Sample" (with no extensions) exist in the folder "D:\BEM_Source\"?
Does the SQL Server service account have permission to that folder?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 17, 2014 at 3:21 am
mandir.jain (2/17/2014)
Thanks for replyingbulk insert sample1
from 'D:\BEM_Source\Sample'
with
(
rowterminator = '',
fieldterminator= ','
)
So, the obvious thing is - does 'D:\BEM_Source\Sample' exist in that folder and on the server that the command is being run from? If I run a Bulk Insert from my PC but connected to server 'Fred1', the file has to be on 'Fred1'.
If it is in the correct location, can you open the file with a text editor? Just to make sure it isn't corrupt or has attributes/permissions set that make it impossible to open for some strange reason.
February 17, 2014 at 3:31 am
the file is there. I tried with extensions also like sample.csv and all but no luck. I don know whether sa login used is having the permission to read or not, if it doesnot hav ,please explain how to give
February 17, 2014 at 3:32 am
the file is there. I tried with extensions also like sample.csv and all but no luck. I don know whether sa login used is having the permission to read or not, if it doesnot hav ,please explain how to give
February 17, 2014 at 3:48 am
Not asking about the login you are using to SQL Server. Asking about the account that SQL Server runs under.
The file name you're specifying has no extension. Go to that folder on the server and make sure that the file there also has no extension (remember windows hides extensions by default). Don't guess, access that folder on the server and check exactly what the name is.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 17, 2014 at 4:06 am
The sql service is running under Network Service. I tried with extensions also:-)
February 17, 2014 at 4:07 am
That could be part of the problem.
First, have you logged on to the server and checked exactly what that file's name and extension is?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 17, 2014 at 4:10 am
Both file and sql server are in local only. I went to the the folder and checked ,both are same.
February 17, 2014 at 4:12 am
sorry I dint get ur saying 'have you logged on to the server and checked exactly what that file's name and extension is'.
February 17, 2014 at 4:55 am
any help please
February 17, 2014 at 7:08 am
You say your statement is this:
bulk insert sample1
from 'D:\BEM_Source\Sample'
with
(
rowterminator = '',
fieldterminator= ','
)
Questions:
1. Have you logged in to the server to see if the file is really there?
2. If the file is there, is the path and filename an exact match to what you've posted above including extension?
3. Are you able to open the file and see that there's data in it?
February 17, 2014 at 7:14 am
It appears you are guessing the extension of the file.
If you open up the D:\ drive in windows explorer, go to the directory you have listed, then right click on the file and choose Properties.
Type of File should show the extension.
Viewing 15 posts - 1 through 15 (of 21 total)
You must be logged in to reply to this topic. Login to reply