Home Forums SQL Server 2008 SQL Server 2008 - General BCP command to import data from txt file (Pipe as Field terminator)into SQL Table. RE: BCP command to import data from txt file (Pipe as Field terminator)into SQL Table.

  • anand_vanam (8/6/2011)


    Hi all

    I am facing hard time in configuring the BCP command to to import data from txt file (Pipe as Field terminator)into SQL Table.

    As the TAB is the default field terminator for BCP. And My source file is | (Pipe delimited file)

    I tried this

    BCP Work.dbo.Customer IN "\\MyMechine\Shared\Cust.txt" -T -S "SQLSERVER" -t|

    Am I missing some thing here.

    Please help me.

    Are you getting an error or what? You haven't told us what the problem actually is. 😉

    --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)