Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2026 05:06 AM - edited 01-10-2026 05:07 AM
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
Caution:
This should work, but it adds complexity, dynamic SQL, and more room for errors in larger pipelines.