Help with Bulk Insert Error

  • I have a Bulk Insert with a format file that worked 2 days ago and is failing today. It looks like this:

    BULK INSERT Table1

    FROM '\\server1\importfile.txt'

    WITH (FORMATFILE = '\\server1\format.fmt')

    When I run it I get the following error and cannot figure out what is causing it:

    Server: Msg 4862, Level 16, State 1, Line 1

    Could not bulk insert because file '(null)' could not be read. Operating system error code 2(The system cannot find the file specified.).

    Server: Msg 7399, Level 16, State 1, Line 1

    OLE DB provider 'STREAM' reported an error. The provider did not give any information about the error.

    OLE DB error trace [OLE/DB Provider 'STREAM' IRowset::GetNextRows returned 0x80004005:  The provider did not give any information about the error.].

    The statement has been terminated.

  • am i wrong, or is this just a simple file does not exist error?

    i realize you probably changed some values for the example, but is there really a \\server1?

    in the context of the job, can the user running the job see  \\server1?

    it might be that the account being used does not have network priviledges, teh server is mispelled, or the server is simply offline/turned off?

     

    just a few ideas; HTH

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • If I changed either path to an invalid path I received a different (better) file not found error. What I found out was that there was a problem when the data file was transferred to the server and the file was corrupt. All it took was transferring the file again and everything worked perfectly.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply