Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Posts
    11

    Unanswered: Bcp Pipe Delimited

    Hi All,
    I am here trying to bcp a table from MACRiskUAT database to a pipe-delimited file . I am giving the following command

    bcp MACRiskUAT..CSADetail out MACRisk_CSADetail.csv -c -t | -Uuma -Preddy -Sdoc3cop

    which is giving me the following error:

    '-Uuma is not recognized as an internal or external command,
    operable program or batch file.

    If I am trying to copy to a comma delimited file it is working fine.
    here is the command for it
    bcp MACRiskUAT..CSADetail out MACRisk_CSADetail.csv -c -t , -Uuma -Preddy -Sdoc3cop

    Please let me know if you have any idea . I already tried with '|' and "|" and \ | ... But its giving me the same error. Thanks for your time.

  2. #2
    Join Date
    Feb 2004
    Posts
    28

    Re: Bcp Pipe Delimited

    Please try -t \| (no space between \ and | )

    Also, -t "|" works on my platform.


    j

    Originally posted by umareddy
    Hi All,
    I am here trying to bcp a table from MACRiskUAT database to a pipe-delimited file . I am giving the following command

    bcp MACRiskUAT..CSADetail out MACRisk_CSADetail.csv -c -t | -Uuma -Preddy -Sdoc3cop

    which is giving me the following error:

    '-Uuma is not recognized as an internal or external command,
    operable program or batch file.

    If I am trying to copy to a comma delimited file it is working fine.
    here is the command for it
    bcp MACRiskUAT..CSADetail out MACRisk_CSADetail.csv -c -t , -Uuma -Preddy -Sdoc3cop

    Please let me know if you have any idea . I already tried with '|' and "|" and \ | ... But its giving me the same error. Thanks for your time.

  3. #3
    Join Date
    Feb 2004
    Posts
    11

    Re: Bcp Pipe Delimited

    Thanks for your reply "|" worked but \| didn't .......Uma

  4. #4
    Join Date
    Oct 2011
    Posts
    3
    --Generate BCP DOS command to export pipe delimited data.

    DECLARE @BCPCommandString VARCHAR(8000)
    DECLARE @FilePath VARCHAR(1000)
    DECLARE @FileName VARCHAR(1000)
    DECLARE @SPName VARCHAR(1000)
    DECLARE @ServerName VARCHAR(1000)
    DECLARE @tSQL VARCHAR(1000)

    SET @ServerName = 'myServer'
    SET @tSQL = 'Select top 10 * from myTable'
    SET @FilePath = 'C:\temp\'
    SET @FileName = 'myFileName.tmp'

    SET @BCPCommandString = 'bcp "' + @tSQL + '" queryout ';

    SET @BCPCommandString = @BCPCommandString + @FilePath + @FileName;

    SET @BCPCommandString = @BCPCommandString + ' -S ' + @ServerName;

    SET @BCPCommandString = @BCPCommandString + ' -T -c -t^| -U username -P password';

    SELECT @BCPCommandString;

  5. #5
    Join Date
    Feb 2012
    Posts
    133
    on what version of ASE does queryout option available? I don't see any queryout option bcp under ASE 12.5. thanks

  6. #6
    Join Date
    Mar 2008
    Posts
    96
    -t and -r are used as column and row dilimitar.
    after -t and -r u can give any combination of special character enclosed in single or double quotes.
    for more information please follow the below limit.
    SyBooks Online

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •