SQL Server - after insert trigger - update another column in the same table

后端 未结 7 823
一向
一向 2020-12-04 22:27

I\'ve got this database trigger:

CREATE TRIGGER setDescToUpper
ON part_numbers
 AFTER INSERT,UPDATE
AS
DECLARE @PnumPkid int, @PDesc nvarchar(128)

SET @Pnum         


        
7条回答
  •  离开以前
    2020-12-04 22:49

    Yes, it will recursively call your trigger unless you turn the recursive triggers setting off:

    ALTER DATABASE db_name SET RECURSIVE_TRIGGERS OFF 
    

    MSDN has a good explanation of the behavior at http://msdn.microsoft.com/en-us/library/aa258254(SQL.80).aspx under the Recursive Triggers heading.

提交回复
热议问题