SSDT error SQL46010 on iif
SSDT reports an error on this valid syntax:
create procedure test
if (iif(1 = 1, 1, 0)
Severity Code Description Project File Line Suppression State
Error SQL46010: Incorrect syntax near ). Stored Procedures\Procs2\test.sql 4
Zach Langner commented
I've encountered this problem too. The easiest work around is to use a CASE statement instead as they don't have the same parsing issue. Your code would be:
if (CASE WHEN 1 = 1 THEN 1 ELSE 0 END
Ryabinovskiy Alexander commented
Hello. Do you have any feedback? More than a year passed, and we don`t have any comments from MS. The error is still here, in VS2019.
Procedure can be created, but the DACPAC deployment fails.