Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why error out in 'less Than Sign'
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01323151
Message ID:
01323154
Views:
13
This message has been marked as a message which has helped to the initial question of the thread.
T-SQL doesn't have IIF() function. Use CASE
SELECT (CASE WHEN @price < 0  THEN 'red' ELSE 'black' END) As Color
>
>Can somebody explain why I got error in here,
>
>declare @price as int
>set @price = 5
>SELECT iif( @price < 0 , 'red', 'black' )
>
>
>Msg 102, Level 15, State 1, Line 3
>Incorrect syntax near '<'.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform