Red Gate forums :: View topic - Not possible to proper format a MERGE statement
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Prompt 5
SQL Prompt 5 forum

Not possible to proper format a MERGE statement

Search in SQL Prompt 5 forum
Post new topic   Reply to topic
Jump to:  
Author Message
mspiegel



Joined: 27 May 2013
Posts: 2

PostPosted: Mon May 27, 2013 2:46 pm    Post subject: Not possible to proper format a MERGE statement Reply with quote

Not possible to proper format a MERGE statement.

Please see following snippet:

Code:
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
Back to top
View user's profile Send private message
chriskelly



Joined: 19 Apr 2010
Posts: 309
Location: Cambridge, UK

PostPosted: Tue May 28, 2013 6:00 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
mspiegel



Joined: 27 May 2013
Posts: 2

PostPosted: Tue May 28, 2013 6:15 pm    Post subject: Reply with quote

Thanks for the info.

Actually the MERGE statements exists in SQL Server since 2008.


Cheers
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group