I want to check if a boolean is true, then decide in the WHERE clause what condition to use.
Say the boolean variable is @checkbool:
SELECT * FROM Ta
select * from TableA A where (@checkbool = 1 and A.Id = 123) or (@checkbool = 0 and A.Id <> 123)