MERGE - conditional “WHEN MATCHED THEN UPDATE”
问题 The highlights in the image below shows the logic I want to implement. I realize the syntax is incorrect. Is there a way to conditionally update a record in a MERGE statement only if it the value of one of its columns in the target table is NULL, and the corresponding value in the source table is not null? How would you suggest re-writing this? MERGE dbo.input_311 AS [t] USING dbo.input_311_staging AS [s] ON ([t].[unique key] = [s].[unique key]) WHEN NOT MATCHED BY TARGET THEN INSERT(t.