用output得到剛插入(刪除)數據的標識列值

create table #temp(fid int,fnumber varchar(50),fname varchar(50))

insert into tz_pem_group -- 所要插入數據的表
output inserted.fid,inserted.fnumber,inserted.fname into #temp
values('1213','2120')

select * from #temp
drop table #temp

發佈了3 篇原創文章 · 獲贊 1 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章