I have a main database and a report database, and I need to sync a table from main into report.
main
report
However, when an item
merge into x as target using y as Source on target.ID = Source.ID when not matched by target then insert when matched then update when not matched by source and target.ID is not null then update whatevercolumn = 'isdeleted' ;