Suppose if you want insert table some value and same value insert to another table then bellow Query is useful to you.

 

 

Multi Insert Concept

create table #abc
(
col1 int identity,
col2 varchar(10)
)

create table #bbb
(
col1 int,
col2 varchar(10)
)

insert #abc (col2)
output inserted.col1, inserted.col2 into #bbb
select ‘My Value’

select * from #abc
select * from #bbb

drop table #abc
drop table #bbb

Advertisements