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

Sql Prompt unable to parse MERGE ON MATCH $from_id $to_id edge graph clause


I have the following Merge syntax for an edge table named "owns":

;WITH UidCTE
    AS ( SELECT DISTINCT P.[UId] AS PersonUid ,
                        S.[UId] AS SecurityUid
         FROM ........
      )
MERGE graph.owns AS TGT
USING graph.[User] AS SourceFrom
JOIN UidCTE CTE ON SourceFrom.Id = CTE.PersonUid
JOIN graph.[Security] AS SourceTo ON CTE.SecurityUid = SourceTo.Id
ON MATCH (SourceFrom-(TGT)->SourceTo)
WHEN NOT MATCHED BY TARGET THEN
    INSERT ( $from_id , $to_id )
    VALUES ( SourceFrom.$node_id, SourceTo.$node_id);

Although the query runs correct in a compatibility 140 DB it crashes near $from_id , $to_id with incorrect syntax when trying to format the code using the latest SQL Prompt 10.5 version.
I'm using SSMS 15.
If I remove
 ( $from_id , $to_id ) and if I changed them with the "real" column names the apply layout refactoring will crash with "Object not set as an instance of an object" near the MATCH clause .
Adrian
0

Comments

1 comment

  • Jessica R
    Hi and thanks for your post!

    I am able to reproduce this issue. Please bear with us while we look into this.
    Jessica R
    0

Add comment

Please sign in to leave a comment.