dbTalk Databases Forums  

dumb question

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss dumb question in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
news
 
Posts: n/a

Default dumb question - 09-28-2007 , 07:43 PM






Sorry about this. But I've worked primarily in access for years.

Does SQL Server have a boolean or a yes/no data type for its table columns?

Thanks in advance,

Bill




Reply With Quote
  #2  
Old   
--CELKO--
 
Posts: n/a

Default Re: dumb question - 09-28-2007 , 07:55 PM






Quote:
Does SQL Server have a boolean or a yes/no data type for its table columns?
No, and you should not write SQL that way -- bit flags are too low
level for a high level language. We left BOOLEANs out for good
reasons having to do with 3VL, NULLs and consistent language model.



Reply With Quote
  #3  
Old   
Tony Rogerson
 
Posts: n/a

Default Re: dumb question - 09-29-2007 , 04:20 AM



Hi Bill,

No it doesn't, people usually use the BIT data type which holds 0 or 1; some
folk like myself use Y or N / T or F in a char(1) column.

Tony.

--
Tony Rogerson, SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson
[Ramblings from the field from a SQL consultant]
http://sqlserverfaq.com
[UK SQL User Community]


"news" <wjfwjr (AT) hotmail (DOT) com> wrote

Quote:
Sorry about this. But I've worked primarily in access for years.

Does SQL Server have a boolean or a yes/no data type for its table
columns?

Thanks in advance,

Bill





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.