I have 2 table one is a Stage table whose schema is exac to main,i want to update the data from stage table to main table with the ID column as refrential key. I have tried
You can refer to the merge source in the insert part, like:
insert
when not matched then insert (id, name, email_id) values (stage.id, stage.name, stage.email_id)