Results 1 to 4 of 4

Thread: Bulk insert problem.

  1. #1
    Join Date
    Nov 2005
    Posts
    2

    Bulk insert problem.

    I have a problem with bulk insert.
    I try to insert an .xls file to a database table, but I don't know what values should I put in the FIELDTERMINATOR and the ROWTERMINATOR. I tried almast every posible combination mostly this one:
    BULK INSERT DBname..tablename FROM '\\cs_file\public\test\teszt_import.xls'
    WITH (
    DATAFILETYPE = 'native',
    FIELDTERMINATOR = '\t',
    ROWTERMINATOR = '\n'
    )

    I get the following error message:
    Bulk Insert fails. Column is too long in the data file for row 1, column 1. Make sure the field terminator and row terminator are specified correctly.

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Try save it as .csv file.

  3. #3
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    As RMIAO said use CSV, BULK INSERT does not work with non text files. If you must use XLS file, use DTS.

  4. #4
    Join Date
    Nov 2005
    Posts
    2
    Thank you for your help. I saved it as a CSV, so now it works.

Posting Permissions

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