set a field that stores a boolean (true/false)

set a field that stores a boolean (true/false)

Post by Tarre » Mon, 10 Dec 2001 11:00:30



How would i define a column to store data type boolean?  Thanks.
 
 
 

set a field that stores a boolean (true/false)

Post by oj » Mon, 10 Dec 2001 11:10:23


tarren,

sqlserver does not have *boolean* datatype.

please see sql book online for more details...

http://msdn.microsoft.com/library/en-us/tsqlref/ts_da-db_7msw.asp

-oj


Quote:> How would i define a column to store data type boolean?  Thanks.


 
 
 

set a field that stores a boolean (true/false)

Post by Tarre » Mon, 10 Dec 2001 11:29:37


Thank you.  I will use the bit type which can hold only 1 or 0.


> tarren,

> sqlserver does not have *boolean* datatype.

> please see sql book online for more details...

> http://msdn.microsoft.com/library/en-us/tsqlref/ts_da-db_7msw.asp

> -oj



> > How would i define a column to store data type boolean?  Thanks.

 
 
 

set a field that stores a boolean (true/false)

Post by oj » Mon, 10 Dec 2001 15:11:15


tarren,

'bit' can be either 1, 0 or Null.

-oj


> Thank you.  I will use the bit type which can hold only 1 or 0.



> > tarren,

> > sqlserver does not have *boolean* datatype.

> > please see sql book online for more details...

> > http://msdn.microsoft.com/library/en-us/tsqlref/ts_da-db_7msw.asp

> > -oj



> > > How would i define a column to store data type boolean?  Thanks.

 
 
 

set a field that stores a boolean (true/false)

Post by Tarre » Tue, 11 Dec 2001 00:45:38


Good point.  thanks.


> tarren,

> 'bit' can be either 1, 0 or Null.

> -oj



> > Thank you.  I will use the bit type which can hold only 1 or 0.



> > > tarren,

> > > sqlserver does not have *boolean* datatype.

> > > please see sql book online for more details...

> > > http://msdn.microsoft.com/library/en-us/tsqlref/ts_da-db_7msw.asp

> > > -oj



> > > > How would i define a column to store data type boolean?  Thanks.

 
 
 

set a field that stores a boolean (true/false)

Post by Lee Johnson [M » Wed, 12 Dec 2001 12:45:22


You can use the Bit data type for this column. It limits the data to be
either a 1 or 0 value.

---------------------
This posting is provided ?AS IS? with no warranties, and confers no
rights.

 
 
 

set a field that stores a boolean (true/false)

Post by oj » Wed, 12 Dec 2001 13:02:16


bit can be either 1, 0 or Null.

-oj



Quote:> You can use the Bit data type for this column. It limits the data to be
> either a 1 or 0 value.

> ---------------------
> This posting is provided ?AS IS? with no warranties, and confers no
> rights.

 
 
 

1. Defining Yes/No, True/False or On/Off for Boolean fields


Well, if you're using Microsoft Access, all boolean types are defined as
Long Integers.  If the value is 0, it represents No, False or Off.  If the
value is any other value, it's Yes, True or On.

About creating the field, that depends a bit on what language you're using.
They all turn out to be almost the same with slight differences in syntax
though.  C++ is its own style, VB is almost identical to VBApp except for
the fact that VBApp doesn't allow strict type definition.  (I think that's
the way VBApp does things... I tend to stick with the typedef languages and
avoid undeclared types.)

In VB, you'd just make a Long or a Boolean value...

Dim lngYesNo as Long
Dim blnYesNo as Boolean

Both of those will work.

When creating the recordset though... it all depends specifically upon what
you're doing.  I suggest experimenting with recordsets...

I'd need more information about what you specifically would like to do.
Tell me exactly what you'd like to achieve, I'll help you from there.

Jim Carlock

2. Oracle DBA worth it?

3. Boolean as True/False or 1/0

4. DTS step completion status

5. Boolean (True/False) Values in mdb file

6. SQL 7 Enterprise RC to SQL 7 Standard final

7. Boolean as True/False or 1/0

8. WANT TO EARN CASH?? NO SCAMS!! NO TRICKS!!

9. True/False fields in SQL Server, How?

10. Insert True/False values into a field of datatype bit

11. SQL, ODBC, Access95: Problems with Query containing True or False-fields

12. Delphi2-Logical Field True<=>Yes,False<=>No Display

13. False or True field