"Sequence Contains No Elements" when formatting a MERGE
a.higgins
Posts: 90 Bronze 2
When I try to format any SQL query containing a MERGE statement using SQL Prompt 7.3.0.418, I get a popup error stating that "SQL Prompt was unable to complete this operation. Problem areas have been highlighted."
The first character in the query is then shown with red underlining, and the tooltip reads "Sequence contains no elements".
The following code is the MCVE to reproduce:
The first character in the query is then shown with red underlining, and the tooltip reads "Sequence contains no elements".
The following code is the MCVE to reproduce:
DECLARE @Table TABLE (x INT,y DATE) MERGE @Table AS Target USING ( SELECT 1 AS x, '2016-08-18' AS y ) AS Source ON Target.x = Source.x WHEN MATCHED AND Target.y != Source.y THEN UPDATE SET Target.y = Source.y WHEN NOT MATCHED BY Target THEN INSERT (x,y) VALUES (Source.x, Source.y) WHEN NOT MATCHED BY Source THEN UPDATE SET Target.y = '1700-01-01' SELECT * FROM @Table t
Comments
Thanks for letting us know about this - we can reproduce this here and will look into a fix (hopefully it'll be in a new build tomorrow)
Thanks!
Aaron.
We've just released a new beta build which should have a fix for this if you'd like to give it a try?
Thanks,
Aaron.