Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2009
    Posts
    6

    Question Unanswered: BULK INSERT error.

    Hi, Im pretty new with databases and Microsoft SQL 2008 so Ive got a little question about a bulk insert.

    Datafile:

    0001;OSLO
    0009;OSLO
    0010;OSLO
    0014;OSLO
    0015;OSLO
    0016;OSLO

    The whole datafile is like this, 2 columns and fieldterminator ;

    The table dbo.Poststed got 2 columns as well.
    Postnummer (INT) and Poststed Varchar(20)

    I use this code to BULK INSERT:
    Code:
    USE Prosjekt
    Bulk insert Poststed From 'D:\poststed.txt
    with
    (
    FIELDTERMINATOR =';',
    DATAFILETYPE = 'widechar',
    ROWTERMINATOR = '/n'
    )
    And here is the error message:

    Msg 4866, Level 16, State 1, Line 2
    The bulk load failed. The column is too long in the data file for row 1, column 2. Verify that the field terminator and row terminator are specified correctly.
    Msg 7399, Level 16, State 1, Line 2
    The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
    Msg 7330, Level 16, State 2, Line 2
    Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".


    If anyone could help me with this I would really appreciate it. I have tried BULK INSERT with other tables as well and some of them executes without problem but some like this one just refuses..

  2. #2
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    ROWTERMINATOR = '/n'

    should be

    ROWTERMINATOR = '\n'

Posting Permissions

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