我下面的代码通不过,应该怎么写呢?create  table t (id int,num int)
insert t 
select 1,2 union all
select 2,3 union all
select 5,3 union all
select 4,89 create  table t2 (id int,num int)gocreate trigger shiyan on t for insertas
insert t2
select * from (select * from inserted where id = 555)--这句错go
insert t
select 555,555 union all
select 666,666select * from tselect * from t2drop table t,t2

解决方案 »

  1.   

    insert t2
    select tbl.* from (select * from inserted where id = 555) tbl改成这样试试看
      

  2.   

    create table t (id int,num int)
    insert t
    select 1,2 union all
    select 2,3 union all
    select 5,3 union all
    select 4,89create table t2 (id int,num int)gocreate trigger shiyan on t for insertas
    insert t2
    select * from (select * from inserted where id = 555)a--这句错go
    insert t
    select 555,555 union all
    select 666,666select * from tselect * from t2drop trigger shiyan
    drop table t,t2