The MERGE command for SQL Server require that the statement ends with a semicolon (;) and that the semicolon remain with the statement when it is executed by the DB server. DbVisualizer use semicolon as the default statement separator and split multiple statements based on the position of semicolons.

To fix this insert the @delimiter command just before the MERGE command in the SQL Commander to temporarily change the statement separator in DbVisualizer.


The following example show how to re-define the statement delimiter to %%.

@delimiter %%;
MERGE x AS y
<code here>
;
%%
@delimiter ;%%

The last @delimiter ;%% command reverts the statement delimiter from %% to semicolon.


There are additional options how to run this.


If the MERGE command is the only statement in the SQL editor then you may instead of the above run it with SQL Commander->Execute Buffer.