SCD-Merge-Wizard icon indicating copy to clipboard operation
SCD-Merge-Wizard copied to clipboard

Add optional support for the EXCEPT operator in the WHEN MATCHED clause

Open jwk6 opened this issue 5 years ago • 2 comments

Add optional support for the EXCEPT operator in the WHEN MATCHED clause, as described here: http://www.made2mentor.com/2013/05/writing-t-sql-merge-statements-the-right-way/

For Example: WHEN MATCHED AND EXISTS (SELECT Source.Column1, Source.Column2 EXCEPT SELECT Target.Column1, Target.Column2)

This will properly handle NULL values in both the source and target, and will be a little more clear and concise for the developer.

EXCEPT is supported in all currently supported versions of SQL Server, and in Azure SQL Database. https://docs.microsoft.com/en-us/sql/t-sql/language-elements/set-operators-except-and-intersect-transact-sql?view=sql-server-ver15

jwk6 avatar Aug 14 '20 21:08 jwk6

Interesting idea!

NowinskiK avatar Aug 14 '20 22:08 NowinskiK

@NowinskiK I'm feeling the urge to do something again. Mind if I work on this one?

jwk6 avatar Jun 01 '21 02:06 jwk6