create table dbo.test1 (id int,name varchar(10))
create table dbo.test2 (id int)

insert into dbo.test1 values(1,'a')
insert into dbo.test1 values(2,'b')

select * from dbo.test1
select * from dbo.test2

update dbo.test1 set name = 'c'
output inserted.id into dbo.test2
where id = 1

posted on 2021-04-14 15:13  HuairongChen  阅读(190)  评论(0编辑  收藏  举报