Merge into table1 as T using [table] as S on T.[Last Name] = S.[Last Name] and T.[First Name] = S.[First Name] When Matched then Update Set T.[middle name] = S.[middle];
Merge into table1 as T using [table] as S on T.[Last Name] = S.[Last Name] and T.[First Name] = S.[First Name] and (T.[middle name] is null or TRIM(T.[middle name]) = '') When Matched then Update Set T.[middle name] = S.[middle];
and TRIM(ISNULL(T.[middle name],'')) = ''
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)