Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Boolean variables?

Author  Topic 

disciple
Starting Member

27 Posts

Posted - 2006-03-31 : 19:11:25
Im wondering how to do a boolean equivilent while creating tables. here is an example:
ProgramNo NUMBER(10) NOT NULL,

Instead of Number(10) how would I make that a boolean in sql? Im sorry if this is a really easy question, but I looked around online and either was looking for the wrong thing or couldnt find it.

Well i guess thats not entirely true, I found it on wikipedia, but just swapping in BOOLEAN doesnt work. Can anyone tell me the syntax? Thanks

DustinMichaels
Constraint Violating Yak Guru

464 Posts

Posted - 2006-03-31 : 19:28:54
Look up the BIT data type in books on line.
Go to Top of Page

disciple
Starting Member

27 Posts

Posted - 2006-03-31 : 19:32:23
thanks found it. Is that the easiest way of doing it?
Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-04-01 : 01:36:23
BIT is the datatype is normally used to store BOOLEAN values. if the BIT is 1 then its true and 0 means its false..

and in your application if you are using grids or anything, then BIT datatype really helps, like when you set the datasource to the gird with these BIT column automatically check boxes appears for TRUE FALSE result sets.

If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them.
Go to Top of Page
   

- Advertisement -