Want same value to be paste from sql to excel

  • Hi,

    I had the following value 01011976 in my sql column.

    But when I copy it in excel it copies as 1011976.

    starting zero is discarded.

    But I want as it as 01011976.

    Please suggest me how to do this.

    Thanks & Regards

    Avdhut Pol

  • Dear Avdhut,

    Although this is not a SQL Related question.

    but here you go.

    In the excel sheet right click on the cell on go to "Format Cells" and select "Text" and click on ok.

    After that paster your value in that cell.

    Hope it helps.

    Regards

    Shafat Husain

    Regards,
    Shafat Husain
    🙂
    And Your Lord Never Forgets...!! (64:19 -- Quran)

  • If you want to export a whole result set to Excel, the easiest way I know of is a small ad free Management Studio add-in called ssmsboost. It can export a result set to excel using the xml format.

    Every column keeps the original data type, so you don't have to deal with different date/number formats and/or conversion to and from numbers and strings.

    -- Gianluca Sartori

  • If it's a one-off copy-and-paste into Excel, you can also type a "'" (single quote) into the cell and append the number on to that. That will have the effect of formatting the cell as text, but won't display the "'".

    John

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

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