标签:一个 HERE div queue 触发器 sys serve else table
create trigger UpdateQueueTableInfo on his_queue after update as begin declare @sysDate datetime; declare @queueDate datetime; declare @appointsid varchar(50); declare @flag int; declare @oldflag int; select @sysDate=GETDATE() from deleted select @queueDate=APPOINTSDATE,@appointsid=APPOINTSID,@flag=FLAG from deleted select @oldflag=FLAG from inserted; --print ‘更新前flag‘ --print ‘更新后flag‘ --提前转登记 if(@sysDate<@queueDate and (@flag=2 or @flag=3) and @oldflag<>@flag) update QUEUEDETAIL set ISPREREGISTER=‘1‘ where APPOINTSID=@appointsid; update HIS_QUEUE set ISPREREGISTER=‘1‘ where APPOINTSID=@appointsid; --else if(@sysDate>=@queueDate) end --ALTER TABLE [myschema].[TAB_USR] ENABLE TRIGGER UpdateQueueTableInfo
标签:一个 HERE div queue 触发器 sys serve else table
原文地址:https://www.cnblogs.com/YYkun/p/11417395.html