using bulk insert

  • Then, you can do one of two things...

    1.  Import to a 3 column staging table (where you can also validate the data before making it live, good safeguard) and transfer from that... or...

    2.  Make a BCP format file... Books Online explains how to do that quite nicely.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • see

    http://www.nigelrivett.net/SQLTsql/BCP_quoted_CSV_Format_file.html


    Cursors never.
    DTS - only when needed and never to control.

  • crprajan,

    Both Jeff and nigelrivett, have valid approaches. There is also a last option of using DTS/SSIS to transform the data from the flat file to the destination table. Even for this option, I would recommend using a staging table, and then copy the imported data from the staging table to the actual destination table.

    Regards,

    Wameng Vang

    MCTS

Viewing 3 posts - 1 through 4 (of 4 total)

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