create table #ttt(id int,name nvarchar(10));
merge into #ttt t
using (select 1 as id ,'eee' as name ) b
on (t.id = b.id)
when matched then
update set t.name = b.name
when not matched then
insert(id,name) values(b.id,b.name);



select * from #ttt;




merge into  a
using  b
on (a.id = b.id)
when matched then
update set a.name = b.name
when not matched then
insert(id,name) values(b.id,b.name);


select * from a;

相关文章:

  • 2022-12-23
  • 2021-06-20
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2021-04-11
猜你喜欢
  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2022-03-07
  • 2021-08-02
  • 2021-09-15
相关资源
相似解决方案