In SQL Server 2012, you can use the IIF function:
SELECT * FROM table WHERE isExternal = IIF(@type = 2, 1, 0)
Also note: in T-SQL, the assignment (and comparison) operator is simply = (and not == - this is C #)
marc_s Apr 25 '13 at 8:35 2013-04-25 08:35
source share