What is the equivalent of the IIF command in SQL Server

–In MS Access you would use :-

Select iif(field>10,”large”, “small”) as Size from Table

–With SQL Server, use the CASE command

SELECT Size =
CASE
WHEN field > 10 THEN “large”
ELSE “small”
END
from Table

Advertisements

#iif