How to return a boolean value on SQL Select Statement?
I tried this code:
SELECT CAST(1 AS BIT) AS Expr1 FROM [User] WHERE (UserID = 20070022)
select CAST(COUNT(*) AS BIT) FROM [User] WHERE (UserID = 20070022)
If count(*) = 0 returns false. If count(*) > 0 returns true.