try: 
create trigger tgtestview
       on dbo.vequipment 
     instead of insert 
as 
    SET QUOTED_IDENTIFIER ON
    if exists(select eqtype  from inserted  where eqtype not in (select eqtype from eqtype ))
            insert into eqtype (eqtype) select eqtype from inserted where eqtype not in (select eqtype from eqtype )
     insert into equipment (make ,model,eqtypeid) select inserted .make ,inserted.model,eqtype.eqtypeid
     from inserted inner join eqtype on inserted.eqtype=eqtype.eqtype
    SET QUOTED_IDENTIFIER OFF

解决方案 »

  1.   

    不行呀,如果添上上述的“set quoted_identifier on ”和;"set quoted_identifier off”以后还是不行
      

  2.   

    --try
    create trigger tgtestview
           on dbo.vequipment 
         for insert 
    as 
        if exists(select eqtype  from inserted  where eqtype not in (select eqtype from eqtype ))
                insert into eqtype (eqtype) select eqtype from inserted where eqtype not in (select eqtype from eqtype )
         insert into equipment (make ,model,eqtypeid) select inserted .make ,inserted.model,eqtype.eqtypeid
         from inserted inner join eqtype on inserted.eqtype=eqtype.eqtype
      

  3.   

    try:SET QUOTED_IDENTIFIER ON
    go
    drop trigger tgtestview
    go
    create trigger tgtestview
           on dbo.vequipment 
         instead of insert 
    as 
        if exists(select eqtype  from inserted  where eqtype not in (select eqtype from eqtype ))
                insert into eqtype (eqtype) select eqtype from inserted where eqtype not in (select eqtype from eqtype )
         insert into equipment (make ,model,eqtypeid) select inserted .make ,inserted.model,eqtype.eqtypeid
         from inserted inner join eqtype on inserted.eqtype=eqtype.eqtype
    go