What are the challenges you face when working across database platforms? Take the survey

Exporting bit values as "True" and "False" in Excel

frodriguezfrodriguez Posts: 4 New member
edited March 27, 2018 4:58PM in SQL Prompt

I have the following result table : 


If I were to export that in Excel via the "Open in Excel" context menu, my values are converted to "True" and "False" respectively for 1 and 0. Is there a way to preserve those values as 0 and 1?

This is on SQL Server 11. SQL Prompt is at version


  • Options
    FabiolaBFabiolaB Posts: 54 Silver 3
    Hi @frodriguez,

    What type is your Status column? Is it an INT or a BIT?
    You can try casting your Status column to INT. When you open this result in Excel, the values won't get converted. eg Select Cast(Status as int) from yourTable; I hope this helps, Fabiola

  • Options
    frodriguezfrodriguez Posts: 4 New member
    Thanks, it is a BIT.

    I noticed something similar for NULL. The NULLs get converted to blanks. 
Sign In or Register to comment.