Not possible to proper format a MERGE statement

Provides intelligent code completion for SQL Server editors.

Moderators: JonathanWatts, David Atkinson, Anu Deshpande, Paul Stephenson, Michelle Taylor, Mike Upton, justin.caldicott, Aaron Law

Not possible to proper format a MERGE statement

Postby mspiegel » Mon May 27, 2013 2:46 pm

Not possible to proper format a MERGE statement.

Please see following snippet:

Code: Select all
MERGE [X] AS L
    USING
        (
          SELECT
                [X]
            FROM
                [X]
            WHERE
                [X] = X
        ) AS SRC
    ON L.ID = SRC.ID
    WHEN MATCHED
        THEN UPDATE
            SET
                X.[X] = 'X'
    WHEN NOT MATCHED
        THEN
INSERT
               
          (
            [Col1],
            [ColX]
          ) VALUES
                (
                  1,
                  X
                );


1) The INSERT keyword has no indent
2) Between INSERT keyword and the first parenthese is one line break too much
3) The VALUES keyword is not on a new line
mspiegel
 
Posts: 2
Joined: Mon May 27, 2013 2:38 pm

Postby chriskelly » Tue May 28, 2013 6:00 pm

Thank you for your post.

I believe that MERGE is a new feature for SQL Server 2012. While SQL Prompt does support this version, it does not yet support all the new features. So I believe that this is why you are seeing odd behaviour.

I have therefore logged a report on our bug tracking system for the development team to take a look at.
Chris Kelly
Technical Support Engineer
chriskelly
 
Posts: 330
Joined: Mon Apr 19, 2010 1:44 pm
Location: Cambridge, UK

Postby mspiegel » Tue May 28, 2013 6:15 pm

Thanks for the info.

Actually the MERGE statements exists in SQL Server since 2008.


Cheers
mspiegel
 
Posts: 2
Joined: Mon May 27, 2013 2:38 pm


Return to SQL Prompt 5

Who is online

Users browsing this forum: No registered users and 1 guest