Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
nextaxtion
Yak Posting Veteran
54 Posts |
Posted - 2013-10-14 : 01:28:30
|
i had a query and i need to insert record in table and also want to select output of query. actually i need to insert and show data in same query kinldy help ;with cte as ( select id , status from tbl_main where id = 15555 ) insert into testinsert (id , status) select * from cteprithvi nath pandey |
|
VeeranjaneyuluAnnapureddy
Posting Yak Master
169 Posts |
Posted - 2013-10-14 : 01:36:57
|
;with cte as (Select Id,StatusFrom tbl_mainwhere Id = 15555) insert testinsert select * from cteveeranjaneyulu |
|
|
nextaxtion
Yak Posting Veteran
54 Posts |
Posted - 2013-10-14 : 01:49:25
|
VeeranjaneyuluAnnapureddy , i had also write this query but this only inserts record in table i need to also show records. prithvi nath pandey |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-10-14 : 01:55:38
|
[code]insert into testinsert (id , status)output inserted.id,inserted.statusselect id , status from tbl_main where id = 15555[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|