Sql Prompt unable to parse MERGE ON MATCH $from_id $to_id edge graph clause
AdrianFilipescu
Posts: 1 New member
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 ........
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 .
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 .
Tagged:
Answers
I am able to reproduce this issue. Please bear with us while we look into this.
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?