|
U8问题库
问题名称: |
存货档案挂触发器后保存不成功 |
问题号: |
200712240078 |
软件版本: |
8.70sp |
适用产品: |
供应链 |
软件模块: |
采购管理 |
最后更新时间: |
2008-1-8 23:14:51 |
问题现象: |
触发器在存货档修改出现提示“系统忙,请稍后再试”,我在数据库中修改存货档时触发成功的,触发器如:
CREATE TRIGGER [tccb] ON [dbo].[Inventory]
FOR UPDATE
AS
update pu_appvouchs set pu_appvouchs.funitprice=isnull(Inventory.iinvncost,0) ,
ftaxprice=isnull(Inventory.iinvncost,0)*(1+isnull(pu_appvouchs.ipertaxrate,0)),
fmoney=isnull(Inventory.iinvncost,0)*(1+isnull(pu_appvouchs.ipertaxrate,0))*isnull(pu_appvouchs.fquantity,0)
FROM dbo.PU_AppVouchs INNER JOIN
dbo.PU_AppVouch ON dbo.PU_AppVouchs.ID = dbo.PU_AppVouch.ID INNER JOIN
inserted ON
dbo.PU_AppVouchs.cInvCode = inserted.cInvCode INNER JOIN
dbo.Inventory ON inserted.cInvCode = dbo.Inventory.cInvCode
WHERE (ISNULL(dbo.PU_AppVouch.cVerifier, '') <> '')
print '执行完成' |
解决方案: |
您好:
不仅仅是去掉print!
请使用如下语句测试:
CREATE TRIGGER [tccb] ON [dbo].[Inventory]
FOR UPDATE
AS
SET
SET NOCOUNT ON
update pu_appvouchs
set pu_appvouchs.funitprice=isnull(inserted.iinvncost,0) ,
ftaxprice=isnull(inserted.iinvncost,0)*(1+isnull(pu_appvouchs.ipertaxrate,0)),
fmoney=isnull(inserted.iinvncost,0)*(1+isnull(pu_appvouchs.ipertaxrate,0))*isnull(pu_appvouchs.fquantity,0)
FROM dbo.PU_AppVouchs
INNER JOIN dbo.PU_AppVouch ON dbo.PU_AppVouchs.ID = dbo.PU_AppVouch.ID
INNER JOIN inserted ON dbo.PU_AppVouchs.cInvCode = inserted.cInvCode
--INNER JOIN dbo.Inventory ON inserted.cInvCode = dbo.Inventory.cInvCode
WHERE (ISNULL(dbo.PU_AppVouch.cVerifier, '') <> '')
SET NOCOUNT OFF
注:由于网站会自动修改一些字符,请拷贝后注意修改为正确的字符才能生成触发器。
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
触发器在存货档修改出现提示“系统忙,请稍后再试”,我在数据库中修改存货档时触发成功的,触发器如:
CREATE TRIGGER [tccb] ON [dbo].[Inventory]
FOR UPDATE
AS
update pu_appvouchs set pu_appvouchs.funitprice=isnull(Inventory.iinvncost,0) ,
ftaxprice=isnull(Inventory.iinvncost,0)*(1+isnull(pu_appvouchs.ipertaxrate,0)),
fmoney=isnull(Inventory.iinvncost,0)*(1+isnull(pu_appvouchs.ipertaxrate,0))*isnull(pu_appvouchs.fquantity,0)
FROM dbo.PU_AppVouchs INNER JOIN
dbo.PU_AppVouch ON dbo.PU_AppVouchs.ID = dbo.PU_AppVouch.ID INNER JOIN
inserted ON
dbo.PU_AppVouchs.cInvCode = inserted.cInvCode INNER JOIN
dbo.Inventory ON inserted.cInvCode = dbo.Inventory.cInvCode
WHERE (ISNULL(dbo.PU_AppVouch.cVerifier, '') '')
print '执行完成' |
|