USE [GURMEN] GO /****** Object: Trigger [dbr].[utrg_DisableCDCTableAfterDelete] Script Date: 7.11.2016 10:33:13 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: Cuneyd Tanriverdi -- Create date: 04-11-2016 -- Description: After delete den sonra, tabloyu CDC den disable et -- ============================================= ALTER TRIGGER [dbr].[utrg_DisableCDCTableAfterDelete] ON [dbr].[DBA_CaptureInstance] INSTEAD OF DELETE AS DECLARE @tblName VARCHAR(100) BEGIN SET NOCOUNT ON; SELECT @tblName = TableName FROM deleted EXECUTE [GURMEN].[dbr].[dba_cdcDisableForReplicateTables] @tableName = @tblName DELETE FROM [GURMEN].[dbr].[DBA_CaptureInstance] WHERE [capture_instanceID] IN ( SELECT [capture_instanceID] FROM deleted) END