日期:2014-05-17  浏览次数:20509 次

Sql 2000 触发器没被触发

create trigger trg_bil_changedtl_insert         
on bil_changedtl for insert,update         
as          
set nocount on    
declare @shoptype smallint,@shopmode smallint,@shopcode char(10),@parmvalue smallint      
 
select @shoptype = type,@shopmode = mode,@shopcode = shopcode 
from inf_thisshop          

if @shoptype = 1 or @shopmode = 1

begin           
insert into log_goods_price_change
select shopcode,oldgdsincode,1,billno,oldsaleprice,newsaleprice,null,null,changedate
from inserted,inf_department
where inserted.deptcode = inf_department.deptcode
                and inserted.dealflag = 2
end       
set nocount off
;
create trigger trg_bil_change_shoppricedtl_insert         
on bil_change_shoppricedtl for insert,update         
as          
set nocount on    
declare @shoptype smallint,@shopmode smallint,@shopcode char(10),@parmvalue smallint      
 
select @shoptype = type,@shopmode = mode,@shopcode = shopcode 
from inf_thisshop          

if @shoptype = 1 or @shopmode = 1

begin           
insert into log_goods_price_change
select deptcode,gdsincode,1,billno,oldshopprice,newshopprice,null,null,changedate
                from inserted
                where inserted.dealflag = 2
end       
set nocount off



上面是个触发器

我在自己笔记本生测试一点问题没有(w7系统)

在xp系统上没被触发?? 求解



------解决方案--------------------
不会因为os不同而运行结果不同。 
lz肯定还是数据库中的相关结构或者是数据存在差异。 检查一下看看。 

------解决方案--------------------


是不是被禁用掉了呢 !!
执行一下这句话试试



        ALTER TABLE bil_changedt ENABLE TRIGGER ALL 


------解决方案--------------------
加输出代码 看看是没触发还是执行错了
------解决方案--------------------