日期:2014-05-18  浏览次数:20739 次

创建触发器以后插入数据 提示 "对象名'instered'无效",大虾帮忙看一下
触发器语句:
Text
create trigger t_fqzb_toGGZY on 表1
for insert  
as  
set xact_abort on  
begin distributed tran  
if exists(select 1 from inserted) and not exists(select 1 from deleted)  
begin  
  
  insert SV2.数据库.dbo.表2(xh,sgzbbm, gcmc, fqzbsm,fqzbsj,spr, spsj,iffb,sjzbr,Bbh,Czlx,Dqbz,Czsj,Bz2)  
select xh,sgzbbm, gcmc, fqzbsm,fqzbsj,spr, spsj,iffb,sjzbr,1,'0',0,getdate(),'' from instered  
end  
commit tran



在建完触发器以后做测试插入数据就提示

未更新任何行

错误消息:对象名'instered'无效


------解决方案--------------------
名'instered'

inserted
------解决方案--------------------
inserted
------解决方案--------------------
探讨
触发器语句:
Text
create trigger t_fqzb_toGGZY on 表1
for insert
as
set xact_abort on
begin distributed tran
if exists(select 1 from inserted) and not exists(select 1 from deleted)
begin
……