This is super annoying. After finally working out the full syntax of the MERGE statement I discover it is not supported in database procedures! Boo to that. Roy