Azure-Player / SCD-Merge-Wizard

SCD Merge Wizard is an application which will help you generate T-SQL statement for merging data from two tables into one table in minutes. At the end, generated T-SQL statement can be used to replace Microsoft's SSIS Slowly Changing Dimension component.
GNU General Public License v3.0
42 stars 18 forks source link

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

Open jwk6 opened 4 years ago

jwk6 commented 4 years ago

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

NowinskiK commented 4 years ago

Interesting idea!

jwk6 commented 3 years ago

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