|
-
Dec 19th, 2008, 04:06 AM
#1
Thread Starter
Addicted Member
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
Failing to plan is Planning to fail 
-
Dec 19th, 2008, 08:02 AM
#2
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?
-
Dec 19th, 2008, 09:44 AM
#3
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
-
Dec 19th, 2008, 10:34 AM
#4
Re: Could not Bulk Insert : Error Path does not exist.
you CANNOT use a UNC path
Bulk Insert supports UNC paths.
-
Dec 19th, 2008, 12:01 PM
#5
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
-
Dec 22nd, 2008, 12:42 AM
#6
Thread Starter
Addicted Member
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.
Failing to plan is Planning to fail 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|