Forum Discussion

Arulmouzhi's avatar
Arulmouzhi
Copper Contributor
Aug 18, 2021

Azure Synapse Analytics Dedicated SQL pool - IIF statement Support required

Trying to use IIF() in SELECT statement and getting the error "Incorrect syntax near '>'." in Azure Synapse Analytics-Dedicated SQL pool

 

Tried like below:

SELECT IIF(1>2, 'YES', 'NO');
 

This(attached pic as ref) error makes me to believe that IIF statement is not working at all in Azure Synapse Analytics Dedicated SQL Pool.

 

Also this document link confirms that as well - IIF (Transact-SQL) - SQL Server | Microsoft Docs

 

Knew that, CASE is alternative, but want to know Is there any specific reason behind this non-working of IIF (or) not implementing  in Synapse Dedicated SQL pool?

 

Any know-how regarding this is much appreciated!

 

3 Replies

    • Samomer's avatar
      Samomer
      Copper Contributor

      I had to convert all my IIF statements to CASE. I am just wondering if it will be supported in the future?
      Thanks

  • noahyaagoubi's avatar
    noahyaagoubi
    Copper Contributor
    having the same issue, need clarity on whether or not IIF is supported. would rather not refactor many queries to use CASE statements

Resources