这是这样做的“正确”方式吗?
merge dbo.tableA as tgt
using (select #temptable.pkid, @spParam1 as col1, @spParam2 as col2 from #temptable)
as src
on tgt.pkid = src.pkid
when not matched by target when
insert (pkid, thing1, thing2) values (src.pkid, col1, col2)
;
有不同的或更好的方法吗?