distal-attribute
distal-attribute
distal-attribute
distal-attribute

MERGE statement must be terminated by a semi-colon

Thomas Michel posted 2 months ago in General

Hello,

the following MERGE query is working fine out of SQL Management Studio (11.0.6248.0; SQL Server 2012) but throws an error when executed in HeidiSQL portable (9.4 & 9.4.0.5174).

MERGE
    INTO Cube.dbo.MergeDB AS MDB
    USING (VALUES ('AAA','BBB')) AS X ([A],[B])
    ON (MDB.[WertA] = X.[A] AND MDB.[WertB] = X.[B])
    WHEN NOT MATCHED BY TARGET THEN
        INSERT (WertA,WertB)
        VALUES (X.[A],X.[B])
    OUTPUT $action, inserted.*;
/* SQL Error (10713): A MERGE statement must be terminated by a semi-colon (;) */
/* Affected rows: 0  Found rows: 0  Warnings: 0  Duration for 0 of 1 query: 0,000 sec. */

I think it the same problem reported by itaysk: .../forum.php?t=20928.

The query is not part of any stored function/procedure/trigger. It is executed on it's own.

Any hints would be highly appreciated :-) Thank you!

Best Regards,

Thomas

Please login to leave a reply, or register at first.