I just moved a database from sql server 2014 to 2019 and now an update trigger does not execute when it should. Here's the first part of the trigger:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[UTrig_Customer]
ON [dbo].[tbCustomer]
AFTER INSERT
AS
DECLARE
@Cust_Id uniqueidentifier,
@auditAction_Id uniqueidentifier
BEGIN
SET NOCOUNT ON;
Bla bla bla...
and the trigger is enabled.
This trigger should insert a row into an audit table, which does not happen. also, when I execute an update statement from the SSDT debugger it does not step into the trigger:
UPDATE tbCustomer
SET
Cust_Name = @Cust_Name,
Cust_Code = @Cust_Code,
Cust_CustTp_Id = @Cust_CustTp_Id,
Cust_Discount = @Cust_Discount,
Cust_St_Id = @Cust_St_Id,
Cust_Cnt_Id = @Cust_Cnt_Id,
Id_Rank = @Id_Rank,
Cust_Notes = @Cust_Notes,
Cust_IsActiveRow = @Cust_IsActiveRow,
Cust_UserId = @Cust_UserId,
Cust_LastModifiedDate = GETDATE(),
Cust_auditAction_Id = @auditAction_Id
WHERE (Cust_Id=@Cust_Id)
any idea why this does not work?