I want to print a simple print statement (1 = 1), I expect the result to be TRUE or 1, but the sql server will tell me: The syntax is incorrect around '='. Why is this?
The same thing will happen for such a statement.
declare @test bit set @test = (1=1)
in short, how can I “see” what is returned from a comparison without using the IF statement
Update: the reason I'm asking is because I'm trying to debug why the following statement
declare @AgingAmount smallint set @AgingAmount = 500 select Amount, datediff(day,Batch.SubmitDate,getdate()) as Aging from myreporrt where datediff(day,Batch.SubmitDate,getdate()) > @AgingAmount
will return all rows even when aging 300 so I wanted to check if the datum (day, dateubmited, getdate ())> 500 returns true or false, but could not find a way to display the result of this comparison.
tsql
Useless hasid
source share