USE [PingService]
GO
/****** Object: StoredProcedure [dbo].[sp_PingServer_failed_sendemail_now] Script Date: 02/26/2010 16:33:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
— =============================================
— Author: Clive Roberts
— Create date: 30 november 2007
— Description: sends infomation to notification services to send email
— =============================================
CREATE PROCEDURE [dbo].[sp_PingServer_failed_sendemail_now]
— Add the parameters for the stored procedure here
@customers_domain varchar(255)
AS
BEGIN
— Start an event batch
DECLARE @BatchID bigint;
EXEC NSPingPingIPs.dbo.NSEventBeginBatchInvoiceData N’InvoiceSPEventProvider’, @BatchID OUTPUT;
— Write three events
DECLARE @ConvertDate DATETIME;
SET @ConvertDate = CONVERT(DATETIME, GetDate(), 120);
EXEC NSPingPingIPs.dbo.NSEventWriteInvoiceData
@EventBatchId=@BatchID,
@ope=1,
@EmailSubject=”WEBSITE NOTIFICATION”,
@Date = @ConvertDate,
@EmailAttachment= “C:itscoldoutside.pdf”,
@RDF_ID = “1”,
@REP_ID = “PDF”,
@EmailBody=@customers_domain
— Flush event batch
EXEC NSPingPingIPs.dbo.NSEventFlushBatchInvoiceData @BatchID;
— Display event batch ID
SELECT @BatchID ‘Event Batch ID’;
END