本文介绍了在这里,我要发布两个触发器,这两个触发器需要区别吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO




ALTER      TRIGGER [PIP_ENTRYINSERT]
   ON dbo.PIP_Entry

AFTER INSERT AS

UPDATE PIP_ENTRY SET pipcode = (SELECT 'PIP'++CONVERT(VARCHAR,MAX(pipcode1)+1) FROM PIP_ENTRY) where pipcode =''
UPDATE PIP_ENTRY SET pipcode1 = (SELECT MAX(pipcode1)+1 FROM PIP_ENTRY) where pipcode1 = 0




GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO


----------------------------


----------------------------

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO




ALTER      TRIGGER [PIP_ENTRYINSERT]
   ON dbo.PIP_Entry

FOR INSERT AS

UPDATE PIP_ENTRY SET pipcode = (SELECT 'PIP'++CONVERT(VARCHAR,MAX(pipcode1)+1) FROM PIP_ENTRY) where pipcode =''
UPDATE PIP_ENTRY SET pipcode1 = (SELECT MAX(pipcode1)+1 FROM PIP_ENTRY) where pipcode1 = 0




GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO



在Advance



Thanks in Advance

推荐答案


这篇关于在这里,我要发布两个触发器,这两个触发器需要区别吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-12 16:16