Azure Synapse Analytics Dedicated SQL pool - IIF statement Support required

Brass Contributor

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
having the same issue, need clarity on whether or not IIF is supported. would rather not refactor many queries to use CASE statements

It is documented, that IIF function is not supported by Azure Synapse Analytics - the name of this platform is not present in the "Applies to" section of the IIF documentation: IIF (Transact-SQL) - SQL Server | Microsoft DocsIIF.jpg

HTH,

Pawel

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