How can I generate "pipe/vertical bar" delimited fields for a text file using bcp?

  • I can't seem to get bcp to generate "pipe/vertical bar" delimited fields in my text file that I'm using through a DTS package.  I've tried and it keeps giving me an err msg.  I've been able to use comma, ?, etc,,.  But not able to use "pipe".  Fellow DBA's please help me out.  Thanks! 

  • So are you exporting data using BCP or the DTS Datapump?

    --------------------
    Colt 45 - the original point and click interface

  • The "pipe" symbol is probably being intercepted by the OS.  Try enclosing it in double quotes: i.e. "|".

  • This appears to work fine in BCP:

    bcp "select top 100 t.col1 + '|' + t.col2 from database..table1 t" queryout c:\textfile.txt -c -Sservername

    steve

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

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