@freestylecoder@jwcarroll And/or:
update tgt
set col1 = src.col1, col2 = src.col2
from SourceTable src
join TargetTable tgt on src.joincol = tgt.joincol
where src.wherecol = tgt.wherecol; -- This is based on the ON clause from the MERGE statement
@freestylecoder@jwcarroll Something like:
insert into tgt(col1, col2)
select col1, col2
from SourceTable src
join TargetTable tgt on src.joincol = tgt.joincol
where src.wherecol <> tgt.wherecol; -- This is based on the ON clause from the MERGE statement
@freestylecoder@jwcarroll A bit late to this one, but yes, use a WHERE clause. Just off the cuff here, so this may not be 100%, but the general ideas is to base the WHERE clause on the ON clause in the MERGE statement (plus any additional condition you need).
Thanks to everyone who came to the #SQLServerGameShow (Developer Edition) @CodeStock. I think we all had a fun time and hopefully learned a bit. #CodeStock.
In early 2016 I predicted that #Hekaton would someday become the de facto standard for tables. Now we're seeing some hints of that with yesterday's announcement that some internal tables will be in-memory in #SQLServer2019. Love it!
I do love the new https://t.co/0H8DGLd98c_db_page_info function in #SqlServer2019. It's a step in the right direction, but the fact that it returns only HEADER info probably means I won't use it terribly often.
Nearly 50 degree temperature drop driving home from #devspace18 ... 80 when I left Alabama this morning; light snow (not sticking) in KC now #SummerToWinterIn12Hours