We help IT Professionals succeed at work.

Bit field in MS SQL

zolf
zolf used Ask the Experts™
on

Hello there,

when i run a query in the management Studio that returns a bit filed col. it shows 0/1,but when i right click on the table and selec open table it shows true/false.why is it so. i am using sql server 2005

cheers
zolf
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
1=True
0=False

The style of presentation is at the discretion of the developers.  

 

Author

Commented:

i know that 1= true and 0= false,but why does management studio show different representation when viewing the table(shows false/true) and when querying the table(shows 0/1)
I think the reason is that the Open feature in SQL was pretty much taken from ACCESS where True/False is used even though in both cases there are simply 0 and 1 values behind them. It is just how the MS was built. Open feature was also meant more for users that are not that familiar with SQL syntax as opposed to the developers who will use more the Query window to write their own SQL statements and would want to see what the actual value is in the table.

It is also possible that in the Tools > Options you can change how the bit values is displayed in the Open table feature. I wouldn't worry too much about it.

Author

Commented:
cheers