Bulk problem...

  • Hi,

    I am trying to do this command:

    exec('BULK INSERT ctbs FROM '''+@caminhoexacto+'''

    with (FIRSTROW =2,FIELDTERMINATOR =''|'' ,ROWTERMINATOR =''|'', tablock)')

    to load a txt file into a table.

    I keep receiving from SQL Server the following error:

    Msg 4832, Level 16, State 1, Line 1

    Bulk load: An unexpected end of file was encountered in the data file.

    Msg 7399, Level 16, State 1, Line 1

    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 1

    Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".

    Can someone help?

    File data:

    RGC|STATUS|DATA|

    S4.03-7647|S|11-11-2011|

    S4.03-8142|S|11-11-2011|

    S4.03-3998|S|11-11-2011|

    S4.03-6047|S|11-11-2011|

    S4.03-5477|S|11-11-2011|

    S4.03-7875|S|11-11-2011|

    S4.03-2730|S|11-11-2011|

    S4.03-2749|S|11-11-2011|

    S4.03-3147|S|11-11-2011|

    S4.03-3772|S|11-11-2011|

    S4.03-6390|S|11-11-2011|

    S4.03-7025|S|11-11-2011|

    S4.03-8680|S|11-11-2011|

    S4.03-9201|S|11-11-2011|

    S4.03-10947|S|11-11-2011|

    S4.03-1872|S|11-11-2011|

    S4.03-2489|S|11-11-2011|

    S4.03-2891|S|11-11-2011|

    S4.03-3569|S|11-11-2011|

    S4.03-4310|S|11-11-2011|

    S4.03-5433|S|11-11-2011|

    S4.03-5379|S|11-11-2011|

    S4.03-6428|S|11-11-2011|

    S4.03-7561|S|11-11-2011|

    S4.03-8229|S|11-11-2011|

    S4.03-9314|S|11-11-2011|

    S4.03-9424|S|11-11-2011|

    S4.03-9221|S|11-11-2011|

    S4.03-9444|S|11-11-2011|

    S4.03-9939|S|11-11-2011|

    S4.03-10670|S|11-11-2011|

    S4.03-10648|S|11-11-2011|

    S4.03-10984|S|11-11-2011|

    S4.03-11045|S|11-11-2011|

    S4.03-1284|S|11-11-2011|

    S4.03-1301|S|11-11-2011|

    S4.03-2011|S|11-11-2011|

    S4.03-2841|S|11-11-2011|

    S4.03-2918|S|11-11-2011|

    S4.03-3321|S|11-11-2011|

    S4.03-3852|S|11-11-2011|

    S4.03-3994|S|11-11-2011|

    S4.03-4738|S|11-11-2011|

    S4.03-4940|S|11-11-2011|

    S4.03-5210|S|11-11-2011|

    S4.03-6104|S|11-11-2011|

    S4.03-5530|S|11-11-2011|

    S4.03-6599|S|11-11-2011|

    S4.03-6571|S|11-11-2011|

    S4.03-6990|S|11-11-2011|

    S4.03-6880|S|11-11-2011|

    S4.03-7410|S|11-11-2011|

    S4.03-7964|S|11-11-2011|

    S4.03-7968|S|11-11-2011|

    S4.03-7900|S|11-11-2011|

    S4.03-8405|S|11-11-2011|

    S4.03-8683|S|11-11-2011|

    S4.03-8999|S|11-11-2011|

    S4.03-8917|S|11-11-2011|

    S4.03-9486|S|11-11-2011|

    S4.03-9593|S|11-11-2011|

    S4.03-9898|S|11-11-2011|

    .....................................

    .....................................

  • exec('BULK INSERT ctbs FROM '''+@caminhoexacto+'''

    with (FIRSTROW =2,FIELDTERMINATOR =''|'' ,ROWTERMINATOR =''|/r/n'', tablock)')

    ?

    change "/" to "\" for ROWTERMINATOR

    I Have Nine Lives You Have One Only
    THINK!

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

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