ManojkMohan
Honored Contributor II

@Dhruv-22 

Problem

When using MERGE INTO ... WITH SCHEMA EVOLUTION, if a column exists in the target table but is not present in the source dataset, that column is left unchanged on matched rows.

Solution Thinking

This can be emulated by introspecting the table and view schemas and generating the UPDATE SET list explicitly, assigning NULL for any target-only columns

ManojkMohan_0-1768050360557.png

Caution:

This should work, but it adds complexity, dynamic SQL, and more room for errors in larger pipelines.