Could not Bulk Insert : Error Path does not exist.
Hi friends,
I want to insert bulk data in my table. I am using the below query. But it giving exception. Could not Bulk Insert:File 'C:\ip-to-country.csv' does not exist.
BULK
INSERT tblAllCountryName
FROM 'C:\ip-to-country.csv'
WITH
(
FIELDTERMINATOR=',',
ROWTERMINATOR='\n'
)
GO
How to solve this proble. Could you please tell me? Hope your's reply soon.
Thanks & Regards
Re: Could not Bulk Insert : Error Path does not exist.
The database forum may be a better place for the question rather than this asp.net forum....but i'll give it a go.
I'm only guessing but could it be that the file is not on the same machine as the SQL server and the statement is looking for the file on it's local C: drive rather than yours?
Re: Could not Bulk Insert : Error Path does not exist.
Correct on all accounts there Fishcake....
When doing a bulk insert it is the SERVER that does it... so the file has to exists on the server, and the path has to be relative to the SERVer.... There is one point of note though, you CANNOT use a UNC path (\\server\someshare\somefolder\sometotherfolder\somefile.txt) as the file it MSUT be on the local drive of the server.
-tg
Re: Could not Bulk Insert : Error Path does not exist.
Quote:
you CANNOT use a UNC path
Bulk Insert supports UNC paths.
Re: Could not Bulk Insert : Error Path does not exist.
does it? I thought I remember reading somewhere that there's problems with doing that (usually permissions related) .... ok, maybe it should have read "you shouldn't use UNC paths" .... ;) I sit corrected.
-tg
Re: Could not Bulk Insert : Error Path does not exist.
Hi dudes,
Thanks for your good response. I got it. Actually we can use UNC path. I am using UNC path and i got the output. I say thanks again.