Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2004

    Unanswered: Emergency in Bulk Insert

    Dear All:

    I have a text file that need to use bulk insert to do the import, but after I run the command line as follows, an error message do come out at once:

    my command line is:

    BULK INSERT im_data
    FROM 'c:\rpt_kiosk\ex051107.txt' WITH (FIELDTERMINATOR = ' ')

    and the error is "unexpected end-of-file(eof) encountered in data file. Now i attached one of the file and hope someone could help me out and let me know what's wrong with it. Thanks for all.

    Best rgds,

    Ivan Vong
    Attached Files Attached Files

  2. #2
    Join Date
    Jun 2003

    Red face Re

    I know this is not the right can try DTS.

  3. #3
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    Can you post the DDL (specifically the CREATE TABLE statement)?


  4. #4
    Join Date
    Jun 2004
    Hi Pat, thanks for asking, in fact I created the table im_data in advance with fileds named col001, col002, col003 .....col0015, each field's data type is varchar with length 500. I hope this could help you out. I cannot use DTS cause the name of the file to load in will change on each day. Thanks for the attention!!!

  5. #5
    Join Date
    Jul 2003
    San Antonio, TX
    You need to break this process into 2. First, load the data into an intermediate table. I usually create a table with 2 or more fields. One of them is the field where the entire data would go, the others may be Identity field, computed field, or another physical column with an explicit data type, that I use to further parse the data. Then I create a view that exposes the field that I intend to use to load the data into. The obvious step after that is to BULK INSERT the file into the table via the view that we created earlier. Once the data is in, - I can either process it completely on the backend, or BCP it OUT into a file in the format that I want to use for the final import.

    Hope it gave you some pointers on how to go about it.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts