working with single quote ' in sql

  • I have 16 digit credit number exporting to excel through asp.net page.

    when I export to excel it shows other numbers!

    I tried with cast to varchar(16) still the same!

    wondering can I pass single quote prefix to this number through SQL.

  • I think you can pass, something like this..

    Select '''' + convert(varchar(10),group_id), * from Group_Test

    But I think it can also be handled while writing it onto the excel?

    P.S: Sorry some table on my db I am showing here as you did not provide any table structure/data etc

    ---------------------------------------------------------------------------------

  • Charming!!! Thank you for the advice.

    Yes, this will add prefix ' to the cc number. Wondering ALL I want is just reflect the same number

    as in the database! Yes, you are right we can parse/write some logic in our front-end code!

    same time I am looking possible outcome from SQL!

    now from SQL XXXXXXXXXXXXXXXX shows 'XXXXXXXXXXXXXXXX in Excel.

    Thnx

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

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