IF EXISTS format suggestion

p heldp held Posts: 3
edited October 29, 2007 7:45AM in SQL Refactor Previous Versions
I am sorry for the cross postings - afterwards, I realized that this is more a SQL refactor comment.

I may be wrong but there does not seem to be an option to force a simple IF EXISTS() condition to ONE line.
Example:

Where
exists ( Select
*
from
@TMMSale T
Where
T.MaxAkey=D.a_Key )
and D.a_Type='I'

Instead, I would prefer the following:
Where
exists ( Select * from @TMMSale T Where T.MaxAkey=D.a_Key )
and D.a_Type='I'

I prefer this because my if exists clauses are typically short and simple and spreading it out across multiple lines seems unwarranted.

I would have figured that the option on "Subquery placement" would apply to an "If exists" clause.

thanks in advance,
Peter.

Comments

  • Thanks for your post.

    I have tested your query, and it does seem like there is no way to force the satatement onto one line.

    I have logged this as a bug with SQL Refactor 1.1. (SR-701)

    This post is now linked to the bug, so we can update it when the status of the bug changes.

    I hope this will suffice for now.
    Chris
  • Sounds great. Thanks for your attention to the matter.
Sign In or Register to comment.