Format MERGE statements
jela
Posts: 13
Hi,
while searching the forum regarding format options for MERGE statements I only came across an entry for SQL Prompt 5:
http://www.red-gate.com/MessageBoard/vi ... ompt+merge
Are there any news regarding this topic? Has anybody found a way to properly format MERGEs?
Kind regards
while searching the forum regarding format options for MERGE statements I only came across an entry for SQL Prompt 5:
http://www.red-gate.com/MessageBoard/vi ... ompt+merge
Are there any news regarding this topic? Has anybody found a way to properly format MERGEs?
Kind regards
Comments
I think 2 of his points are fixed in the latest release of SQL Prompt. It looks to me like to INSERT indentation is still off though so I'll look into that for you now.
Do you have a specific statement that's causing problems?
Thanks,
Aaron.
thanks for the reply and looking into things.
The above is an example statement, which unfortunately isn't 100% formatted as it is in SSMS. Anyway, I'll try to explain, what looks a bit odd.
USING, ON, WHEN MATCHED, WHEN NOT MATCHED are indented, whereas I would understand them to be part of the MERGE statement itself. The keywords THEN UPDATE SET and THEN INSERT are each on a new line - I understand, that it comes down to personal preferences here, but I would see UPDATE SET and INSERT as actions, whereas THEN would belong to the WHEN clause itself. The openening bracket after VALUES is on a new line, whereas the opening bracket after INSERT is on the same line as the keyword.
Maybe it becomes more clear, if I try to show, what I have in mind:
If there already is a way to achieve a formatting similar to this, I would appreciate some hints on how to accomplish this.
Thanks again for your help.
Kind regards,
Jens.
Thanks,
Aaron.
thanks for your changes.
We have been using the private build for a few days now and think, the formatting looks better this way. Thanks again.
Will this be implemented into an upcoming version or do you plan on providing some more options for SQL Prompt?
Kind regards,
Jens
We've just released 6.2.0.241 which includes these changes for how MERGE is formatted. See this post for more details.
Thanks,
Aaron.