bcp extra characters in output file

  • I need your help.

    I am using this from inside my SP to output to a data file

    EXEC master..xp_cmdshell 'bcp xdatabase..h837x out C:\FileExtract.txt -c'

    It works fine, EXCEPT I am ending up with random hex '200D0A's in the output file.  These appear as separate lines. 

    Can anyone explain how they got there and what I need to do to get rid of them?

    Thanks in advance.

    Phil Krieg

     

     

     

     

  • The "-c" parameter, as you are probably aware, uses the CHAR format.  What you might not know is that it adds the "newline" character as well.  Hex "0D" is a carriage return.  Hex "0A" is the linefeed character.  Hex "20" is the space character. 

    Without more information, that's the most I can do for you.

    --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)
    Intro to Tally Tables and Functions

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

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