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
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
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
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