USE [HCITools] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[mon_DML_PH_insurance]') AND type in (N'P', N'PC')) DROP PROCEDURE [dbo].[mon_DML_PH_insurance] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[mon_DML_PH_insurance] @in_debug tinyint = 0 AS /*============================================================================= Explication du traitement realise par la SP ------------------------------------------- La SP va rechercher les modifications de DML pour la table PH insurance les derniers 4h Contexte d'utilisation ---------------------- Appelé depuis le job DR90010 - Central Track PH Insurance DML Alerts Parametres ---------- @in_debug : non utilisé Creation : 10.03.21 / RTC Modifications : 11.08.2021 / spe : #TFS65583# Migrate personal email address from [hcisolutions.ch] to [galenica.com] 07.08.2021 / spe : #TFS65583# Migrate personal email address from [hcisolutions.ch] to [galenica.com] - Corrections 16.03.2022 / FLA : Standardisation des mails 23.10.2023 / tsc : #OCTPDBA-792 remove occurences of christophe.dorion@galenicare.com from mailing lists =============================================================================*/ set nocount on; /*------------------- Declaration des variables --------------------*/ DECLARE @subject NVARCHAR(MAX), @html_msg NVARCHAR(MAX), @html_table NVARCHAR(MAX), @currentDate DATETIME /*------------ Affectation des parametres aux variables ------------*/ SET @currentDate = GETDATE() /*-------------------------- Traitement ---------------------------*/ BEGIN TRY SET QUOTED_IDENTIFIER ON /* Run only on centrals for GCM format */ IF NOT EXISTS (SELECT 1 FROM [master].[cfg].[InstanceContext] WHERE [Business] = 'TPCENT') RETURN IF NOT EXISTS (SELECT 1 FROM [master].[cfg].[Identity] WHERE Format = 'GCM') RETURN /* Formatage du message et envoi */ SELECT @subject = @@SERVERNAME + ' - DML audit PH_insurance' SET @html_table = N'' SELECT @html_table = @html_table + '
| Host Name | SPID | DMA_Event_Info | Application Name | Update Time |
|---|