Results 1 to 3 of 3

Thread: Bulk insert

  1. #1
    Join Date
    Feb 2003
    Location
    Denmark
    Posts
    1

    Unanswered: Bulk insert

    My first try with Bulk insert has failed.

    In MSDE 1.0 I have made a sp with the following command:
    Bulk insert Rute2 From 'c:\Rute.txt' with (Fieldterminator=';', Keepnulls, Codepage='raw')

    The error message is:
    Bulk Insert: Unexpected end-of-file (EOF) encountered i data file.

    The text file end with a: . If removed the insert succed.
    But can I do without that will be nice.
    How can I solve this problem?

  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    Ask the file provider to ommit the non printing character. If that is not an option, you might write a quick script to strip the last line of the file.

    I don't know of a way to tell BCP or Bulk Insert how to deal with this record. Now if you can use DTS things look better.

    I created the following table:
    create table psy(f1 varchar(10),f2 varchar(10),f3 varchar(10))

    I then created the following file:
    ABC;;123
    DEF;;456
    

    I then selected the psy table in EM, selected All Tasks, Import Data, accepted all the defaults, and successfully imported the data.
    Last edited by Paul Young; 02-27-03 at 09:42.
    Paul Young
    (Knowledge is power! Get some!)

  3. #3
    Join Date
    Feb 2003
    Posts
    27
    Did u set the bulkcopy option for the database?

    sp_dboption 'databasename' 'select into/bulkcopy'

Posting Permissions

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