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.
| Author |
Topic |
|
Utpal
Posting Yak Master
179 Posts |
Posted - 2002-03-03 : 00:25:53
|
| Hi everybody, How are the boolean values of "True" and "False" represented in SQL and T-SQL syntax ? |
|
|
Nazim
A custom title
1408 Posts |
Posted - 2002-03-03 : 00:46:06
|
| with 1(True) and 0(false) mostly.eg : isnumeric() will return 1 if it is true or else returns 0 if it is falseif isnumeric('23')=1 HTH--------------------------------------------------------------Edited by - Nazim on 03/03/2002 08:45:17 |
 |
|
|
samrat
Yak Posting Veteran
94 Posts |
Posted - 2002-03-03 : 01:01:28
|
| True is evaluated as 1 and False as 0. and they are stored in BIT datatypeCheers,Samrat |
 |
|
|
Arnold Fribble
Yak-finder General
1961 Posts |
Posted - 2002-03-03 : 08:40:34
|
| In contrast to Access, for example, the outcome of a boolean expression cannot be stored directly (or returned from a query) in SQL Server. SQL Server's bit type is not freely convertable with booleans. For example, where in Access you might saySELECT (column=3) FROM tblIn SQL Server, this would have to be expressed as something likeSELECT CASE WHEN column=3 THEN 1 ELSE 0 END FROM tbl |
 |
|
|
byrmol
Shed Building SQL Farmer
1591 Posts |
Posted - 2002-03-03 : 17:09:02
|
quote: How are the boolean values of "True" and "False" represented in SQL and T-SQL syntax ?
Badly!DavidMTomorrow is the same day as Today was the day before. |
 |
|
|
Utpal
Posting Yak Master
179 Posts |
Posted - 2002-03-04 : 05:40:24
|
| Thanks to all of you ! |
 |
|
|
jcelko
Esteemed SQL Purist
547 Posts |
Posted - 2002-03-25 : 12:07:51
|
| >> How are the boolean values of "True" and "False" represented in SQL and T-SQL syntax? <<Boolean datatypes do not exist in Standard SQL-92. You should not be trying to program with them. If thre was such a thing, then it would have to take the values TRUE, FALSE, and UNKNOWN; but also be NULL-able. Suddenly we are into four values logic!!--CELKO--Joe Celko, SQL Guru |
 |
|
|
|
|
|