In C# we can write single if syntax:
string test;
int value=1;
test = value>=1 ? "is bigger or equal one" : "is less than one";
T-SQL in SQL Server 2008 R2 has single IF syntax?
SQL Server 2008 doesn't, you'd have to use a CASE statement...
SQL Server 2012 does have the function:
SELECT IIF ( @FirstArgument > @SecondArgument , 'TRUE', 'FALSE' )
AS [Output Using IIF Logical Function]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With