The IIF function, which is available in SQL Server 2012, returns one of the two values depending upon whether the Boolean expression evaluates to either True or False.
DECLARE @FirstArgument INT = 10 DECLARE @SecondArgument INT = 20 SELECT IIF ( @FirstArgument > @SecondArgument , 'TRUE', 'FALSE' ) AS [Output]
Comments
Post a Comment