How can we help you today? How can we help you today?

Formatting of IIF does not respect wrapping setting

I would expect an IIF to be able to break at the commas at the very least. After all it is a macro for a CASE statement.

Interestingly it is breaking on arithmetic operators in the THEN and ELSE clauses but not the comparison operator in the boolean expression.

I'd also expect it's closing parenthesis to follow the same rules as other functions. In fact I'd expect it to follow exactly the same formatting rules as any other function.
atompkins
0

Comments

3 comments

  • atompkins
    On further examination it would appear that function handling in general is inconsistent. DATEADD breaks after it's commas regardless of the setting of "commas first". CONVERT does not break at commas.
    atompkins
    0
  • Anu D
    Thanks for your post!

    I have logged a support ticket for you.
    Anu D
    0
  • eugenen
    I would like to add to this. It seems the wrapping is not respected for IF EXISTS ( SUBQUERY TO BE WRAPPED ) it still formats it the same as any other query.
    eugenen
    0

Add comment

Please sign in to leave a comment.