Not able to export the data into excel after apending '%' in the data returned for a column from sql server

  • [font="Times New Roman"]Hi,

    I want to export the data into excel from sql server but the package fails with the error that there can be potential data loss. I am trying to apend '%' in the data returned for a column from sql server, when this error occurs. Please let me know somebody else has faced this earlier & has got a solution for the same.

    -Sujeet [/font]:-)


    Sujeet Singh

  • [font="Times New Roman"] No reply till yet 😎 [/font]


    Sujeet Singh

  • Why are you doing this? Is it because you want a numeric value formatted as % in Excel?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • [font="Times New Roman"] yes Phill , you got it right 🙂[/font]


    Sujeet Singh

  • [font="Times New Roman"]Hi Phill,

    I thought you have got an answer !!! please share it if this is the case.

    [/font]


    Sujeet Singh

  • Sujeet Pratap Singh (10/28/2010)


    [font="Times New Roman"]Hi Phill,

    I thought you have got an answer !!! please share it if this is the case.

    [/font]

    Sorry - I'm in the middle of a course & just dipping in and out.

    Not having a system in front of me, I would say that you need to put the number into Excel as a number and then format it to display as a percentage. Otherwise, you are effectively converting a number (eg 20) to a string ("20%") and it is this changing of data types that is causing you issues.

    This formatting is, however, not straightforward to do from SSIS. You could install Excel on your SSIS server and then use a script task + Excel automation to do it - there are plenty of example out there.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • What I am unsure about is whether Excel interprets the string "20%" correctly as a numeric percentage and does the formatting for you.

    If it does, you should add a derived field, data type string, to store the string value of your numeric field concatenated with % and then output that to Excel.

    Good luck.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

Viewing 7 posts - 1 through 6 (of 6 total)

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