表Writing_Info里有触发器Writing_Taxis_getWritingTaxis如下---自动在插入新作品的时候创建作品的排行
CREATE TRIGGER Writing_Taxis_getWritingTaxis ON [dbo].[Writing_Info] 
FOR INSERT
ASbegin
insert writing_taxis (taxisCategoryid,writingid) (select a.taxiscategoryid,b.writingid from Writing_taxis_category a,inserted b)
end表writing_chapter里有触发器Writing_Info_getLength如下----自动修改文章长度
CREATE TRIGGER Writing_Info_getLength
ON Writing_chapter
For insert,update
as
if @@rowcount=0 returnif exists(select a.writingid from inserted a,writing_info c where a.writingid=c.writingid) begin
update c set c.length=c.length+a.length from inserted a,writing_info c where a.writingid=c.writingid
end当没有第一个触发器的时候,可以正常的根据writing_chapter里的length统计出作品的长度并且存放到writing_info这个表里.但是加上第一个触发器后,每次更新writing_chapter表的时候,会把writing_info里的length这个字段的值给清空.很是郁闷.请教怎么解决?