|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
--select cverifier,CGATHINGCODE,* from [DispatchList] where CDLCODE=0000004538
CREATE TRIGGER [dbo].[SA_Disp] ON [dbo].[DispatchList]
FOR update
AS
if update(cverifier) --and (select cverifier from inserted where cverifier<>'')
begin
if exists (select cverifier from inserted where cverifier<>'')
begin
declare @tmp varchar(400)
declare @str varchar(8000)
declare @str1 varchar(8000)
declare @kk varchar(400)
SELECT @str=CGATHINGCODE FROM inserted-- [DispatchList] WHERE CDLCODE='0000004538'
set @kk=null
SELECT @kk=[cVouchID] FROM [Ap_CloseBill] where [cVouchID] in
(select * from dbo.fsplit(@str,'/')) and [cOrderNo] is null
--set @tmp='收款单:订单号不符,请重新选择收款单!'
--raiserror(@tmp,16,10)
--print @kk
if @kk is not null
begin
set @tmp='收款单:'+@kk+'无订单号,请重新选择收款单!'
raiserror(@tmp,16,10)
end
set @kk=null
SELECT @kk=[cVouchID] FROM [Ap_CloseBill] where [cVouchID] in
(select * from dbo.fsplit(@str,'/')) and [cOrderNo] not in
(select csocode from inserted)--DispatchList WHERE CDLCODE='0000004527')
if @kk is not null
begin
set @tmp='收款单:'+@kk+'订单号不符,请重新选择收款单!'
raiserror(@tmp,16,10)
end
end
end |
|