My question is a bit more generic, but let’s say I want to test some expression in SQL Server. I write SELECT 1=1 or SELECT 'a' > 'B' and press F5, hoping to see the result, like I do when I type SELECT 0, 1.
But I get an error instead. Why is that? What should I use to evaluate those expressions on the fly?
My question is a bit more generic, but let’s say I want to test
Share
SQL Server doesn’t have a boolean data type.
You would need to use
SELECT CASE WHEN 1=1 THEN 1 ELSE 0 END