62,620
社区成员
发帖
与我相关
我的任务
分享
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER trigger Insert_xfjl_max
on xfjl
for insert
as
if ((select sum(xfje) from xfjl where datepart(dd,xfsj)=day(getdate())
and datepart(m,xfsj)=month(getdate()) and datepart(yyyy,xfsj)=year(getdate()) and kpbh = (select kpbh from inserted))> 50)
begin
print '超出当天最大消费了'
rollback;
else
begin
commit
print '执行成功'
end
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO