Results 1 to 6 of 6

Thread: Could not Bulk Insert : Error Path does not exist.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Thumbs up 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

  2. #2
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    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?

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Could not Bulk Insert : Error Path does not exist.

    you CANNOT use a UNC path
    Bulk Insert supports UNC paths.

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Thumbs up 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
  •  



Click Here to Expand Forum to Full Width