How to give Rowterminator manually in BCP?

  • Hi,

    I need to extract the Data pipeline as Column Terminator and : colon as

    Row terminator...

    My Query IS

    declare @sql varchar(8000)

    declare @path varchar(8000)

    set @path ='D:\STOCK_12_05_2010.txt'

    select @sql = 'bcp "set fmtonly off SELECT CODE,LIST_PRICE, WEB_PRICE FROM db.dbo.table " queryout '+@path+' -c -t"|"^ -T -S' + @@servername

    exec master..xp_cmdshell @sql

    IN EXPORT WIZARD WE CAN BUT I NEED IN BCP QUERY

  • Saravanan_tvr (5/15/2010)


    Hi,

    I need to extract the Data pipeline as Column Terminator and : colon as

    Row terminator...

    My Query IS

    declare @sql varchar(8000)

    declare @path varchar(8000)

    set @path ='D:\STOCK_12_05_2010.txt'

    select @sql = 'bcp "set fmtonly off SELECT CODE,LIST_PRICE, WEB_PRICE FROM db.dbo.table " queryout '+@path+' -c -t"|"^ -T -S' + @@servername

    exec master..xp_cmdshell @sql

    IN EXPORT WIZARD WE CAN BUT I NEED IN BCP QUERY

    Lookup the -r argument of BCP in Books Online.

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

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

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