ragged right file data not coming correctly

  • but data is coming correctly from stored proc, there is no issue with that .

    what should i fixed

  • It's simple.....there is a problem with your flat file and you create this flat file with your stored procedure. It must be a problem with the procedure.

    You have an extra line feed (CHAR(10)) where there shouldn't be one so you are either explicitly adding one in the procedure or there is one extant in whatever data you are pulling so you could try a REPLACE to strip the CHAR(10) like REPLACE(<your column>, CHAR(10),'').


    I'm on LinkedIn

  • No, its not. Depending on how you're verifying the results, it may appear to be correct, but you may not be seeing what you need to see to fix this issue.

    1) make sure your results in SSMS are set to text not grids, its pretty easy to see extra CR's in this mode.

    2) copy & paste the output of your SP into notepad++ and look for the malformed chars.

    That's the best I can do with what you've given us to work with.

  • ok i did see my result in text editor in SSMS.

    its not correct after phone its breaking into new line.

    what should i change in my stored proc , to make it correct.

  • coool_sweet (4/13/2015)


    ok i did see my result in text editor in SSMS.

    its not correct after phone its breaking into new line.

    what should i change in my stored proc , to make it correct.

    This is fun as I appear to be invisible in this thread. What does this mean I wonder?????

    To reiterate:

    It's simple.....there is a problem with your flat file and you create this flat file with your stored procedure. It must be a problem with the procedure.

    You have an extra line feed (CHAR(10)) where there shouldn't be one so you are either explicitly adding one in the procedure or there is one extant in whatever data you are pulling so you could try a REPLACE to strip the CHAR(10) like REPLACE(<your column>, CHAR(10),'').


    I'm on LinkedIn

  • i tried to use replace but still getting same result. at phone column from where its breaking into new line.

    also i am using replace while iam inserting values into temp table.

    is this correct?

  • So when you look at the generated text file in notepad++ it still has the LF there where it shouldn't be or is it something else? Can you post your procedure code please?


    I'm on LinkedIn

  • PB_BI (4/13/2015)


    coool_sweet (4/13/2015)


    ok i did see my result in text editor in SSMS.

    its not correct after phone its breaking into new line.

    what should i change in my stored proc , to make it correct.

    This is fun as I appear to be invisible in this thread. What does this mean I wonder?????

    To reiterate:

    It's simple.....there is a problem with your flat file and you create this flat file with your stored procedure. It must be a problem with the procedure.

    You have an extra line feed (CHAR(10)) where there shouldn't be one so you are either explicitly adding one in the procedure or there is one extant in whatever data you are pulling so you could try a REPLACE to strip the CHAR(10) like REPLACE(<your column>, CHAR(10),'').

    means I didn't refresh the page b4 I replied 🙂 Just call me Echo.

  • Manic Star (4/13/2015)


    PB_BI (4/13/2015)


    coool_sweet (4/13/2015)


    ok i did see my result in text editor in SSMS.

    its not correct after phone its breaking into new line.

    what should i change in my stored proc , to make it correct.

    This is fun as I appear to be invisible in this thread. What does this mean I wonder?????

    To reiterate:

    It's simple.....there is a problem with your flat file and you create this flat file with your stored procedure. It must be a problem with the procedure.

    You have an extra line feed (CHAR(10)) where there shouldn't be one so you are either explicitly adding one in the procedure or there is one extant in whatever data you are pulling so you could try a REPLACE to strip the CHAR(10) like REPLACE(<your column>, CHAR(10),'').

    means I didn't refresh the page b4 I replied 🙂 Just call me Echo.

    I didn't mean you 😀


    I'm on LinkedIn

  • If you don't need any whitespace from the column, you could try wrapping the column in RTRIM & LTRIM statements, which should strip any extra unseen chars from the column.

  • it worked thank u so much.

    i use replace(replace(Name,char(10),''),char(13),'')

Viewing 11 posts - 16 through 25 (of 25 total)

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