进销存软件触发器。用于仓储型公司。库存量的变化。

源代码在线查看: 项目工程执行中心出库单触发器.txt

软件大小: 10 K
上传用户: guigong
关键词: 进销 软件 触发器 库存
下载地址: 免注册下载 普通下载 VIP

相关代码

				use [xc]
				go
				
				create trigger xc_cfq_项目工程执行中心出库单
				ON [dbo].[项目工程执行中心出库单]
				After UPDATE
				AS
				Declare @sl as int
				Declare @mc as char
				Declare @cur_sl as int
				select @sl = sl from inserted
				select @mc = mc from inserted
				if exists(select sl from [dbo].[库存]
				where @sl = sl and mc = @mc)
				Begin
				select @sl = sl from [dbo].[库存]
				where @sl = sl and mc = @mc
				if (@cur_sl - @sl 				begin
				delete from [dbo].[库存] where @sl = sl and mc = @mc
				end
				Else
				Begin
				Update [dbo].[库存] set sl= (@cur_sl - @sl)
				where @sl = sl and mc = @mc
				End
				end
				
							

相关资源