I want to print a simple statement print (1=1), i expect the result to be TRUE or 1 but sql server tell me: Incorrect syntax near '='. why is that?
Same will happen for a statement like that
declare @test bit
set @test = (1=1)
in summary how can i "see" what is returned from a comparison without using an 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 with aging of 300 so i wanted to test if datediff(day,datesubmited,getdate()) > 500 returns true or false but could not find a way how to display the result of this comparison.