The MERGE statement uses the contents of a table-valued variable and updates a persistent table in the database. The USING clause specifies the source of the update data. The WHEN MATCHED clause ...
Any chance you can post the sql CREATE TABLE scripts for the tables and fields in question (obscufated if you like)? it would make things a bit easier I think. Also, the specific DBMS would be helpful ...