發表文章

目前顯示的是 6月, 2020的文章

在insert資料時取得序號欄位值(臨時資料表)

drop table if exists #test_t create table #test_t (   sn bigint,   sid nvarchar(50),   no nvarchar(50),   name nvarchar(50) ) insert into test(sid, no, name) output inserted.sn, inserted.sid, inserted.no, inserted.name into #test_t values('123','1','2') insert into test(sid, no, name) output inserted.sn, inserted.sid, inserted.no, inserted.name into #test_t values('222','1','2') select * from #test_t select * from test