Can't i write something in TSQL
declare @set1 int
declare @set2 int
set @set1=1
set @set2=2
select @set1 < @set2
by getting true as result?
I Know i can use
case when @set<@set then 'true'
but can't i do by the way i have written above?
Can't i write something in TSQL
declare @set1 int
declare @set2 int
set @set1=1
set @set2=2
select @set1 < @set2
by getting true as result?
I Know i can use
case when @set<@set then 'true'
but can't i do by the way i have written above?
No; T-SQL
does not treat boolean expressions as data. In the same way, you couldn't assign a boolean expression directly to a bit
field.
SQL Server has no "implied" type that would be boolean from an expression. In reality it could be any type to SQL server and it's arguably convention that says an expression is boolean in .net.
It has a bit data type that is almost like boolean and maps directly to boolean in client code and accepts true or false as strings.
DECLARE @foo bit
SET @foo = 'true' -- = 1