sql server 2008 - unable to insert rows from logic table 'Inserted' into another table -


if insert records in table t1, using output want insert these records logical table 'inserted' table t2. below code. if use below code records inserted t2 table t1 shows blank...can tell me going wrong..

create table t1(id int identity(1,1), name vachar(100))  create table t2(id int, name varchar(100))  declare @t table(id int,name varchar(100))  insert t1(name) output inserted.id,inserted.name @t values('deepak')  insert t2 select * @t 

this strange ..if

select * t1 select * t2 

i value 'deepak' inserted in table t2 , table t1 shows blank.how insert record in both tables t1 , t2 @ same time without using triggers.

a way traction on problem utilize tool sqlfiddle. makes easy share , others looking @ problem :)

sqlfiddle output test

that seems work me, although did see issue had same exact code had above. not sure if it's related temp tables, there's weird happening.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -