SQL SERVER DDL Job Configuration
E.DIN Editor • April 22, 2020
DDL_Daily_Report is a job with 2 steps
Step 1: Run
EXEC [MaintenanceDB].[dbo].[spDDLLog_Info_Email]
----------------
Step 2: Failure
Step 2: Failure
declare @Job_ID uniqueidentifier;
select @Job_ID = job_id from msdb..sysjobs where job_id = $(ESCAPE_NONE(JOBID));
exec usp_GetJobFailureData_Main @Job_ID, 'Alerts@myDomain.com', 'help@myDomain.com', 'HTML'
select @Job_ID = job_id from msdb..sysjobs where job_id = $(ESCAPE_NONE(JOBID));
exec usp_GetJobFailureData_Main @Job_ID, 'Alerts@myDomain.com', 'help@myDomain.com', 'HTML'
/*-------------------------------------------------------------------------------------------*/
BEGIN TRY
EXEC myDatabase.dbo.ProcessingSwitchJob
END TRY
BEGIN CATCH
DECLARE @ ErrorMessage varchar(max) = = 'Exception occurred in proc myDatabase.dbo.ProcessingSwitchJob. Exception detail: '
SELECT @ ErrorMessage = @ ErrorMessage + ''+ ERROR_MESSAGE() + '';
EXEC msdb.dbo.sp_send_dbmail
@profile_name='ReportingMail',
@recipients='systems@domain.com',
@subject='Processing Switch Exception',
@body=@ ErrorMessage ,
@importance='High'
RETURN;
END CATCH
EXEC myDatabase.dbo.ProcessingSwitchJob
END TRY
BEGIN CATCH
DECLARE @ ErrorMessage varchar(max) = = 'Exception occurred in proc myDatabase.dbo.ProcessingSwitchJob. Exception detail: '
SELECT @ ErrorMessage = @ ErrorMessage + ''+ ERROR_MESSAGE() + '';
EXEC msdb.dbo.sp_send_dbmail
@profile_name='ReportingMail',
@recipients='systems@domain.com',
@subject='Processing Switch Exception',
@body=@ ErrorMessage ,
@importance='High'
RETURN;
END CATCH
/*-------------------------------------------------------------------------------------------*/
Declare @ErrorMessage varchar(500);
exec msdb.dbo.sp_send_dbmail
@profile_name='ReportingMail'
,@recipients='systems@domain.com'
,@subject='ERROR PROD01 job: Processing Load Step 2 Switch Fail'
,@body='Scheduled Processing Load ! Please check system.'
SELECT @ErrorMessage=ERROR_MESSAGE() ;
RAISERROR( @ErrorMessage,16,1 );
END CATCH
@profile_name='ReportingMail'
,@recipients='systems@domain.com'
,@subject='ERROR PROD01 job: Processing Load Step 2 Switch Fail'
,@body='Scheduled Processing Load ! Please check system.'
SELECT @ErrorMessage=ERROR_MESSAGE() ;
RAISERROR( @ErrorMessage,16,1 );
END CATCH
SPECIAL NOTES: Please set the following appropriately so that the job logs the error and then continues to the next step.
on job success, goto next step
on job failure, goto next step
on job success, goto next step
on job failure, goto next step
Title: Base64 Encoding With Simple Salt (and decoding)
XPCMD_SHELL Move & Load Data from Directory
***** My Valid Data Monitor **** XML OUT *** HTML EMAIL DELIVERY *****IF OBJECT_ID('tempdb..#tCustomerID') IS NOT NULL DROP TABLE #tCustomerID select distinct mm.CustomerID Into #tCustomerID from myDatabase..myTable (nolock) mm left join myDatabase.dbo.myOtherTable (nolock) mo on mm.refID = mo.id left join myDatabase.dbo.myOtherTableDetail (nolock) mod on mo.id = mod.myOtherTableid and mm.SearchValue = mod.SearchValue where mm.refID is not null and mm.quantity is not null and mod.SearchValue is nullIF Exists (Select 1 From #tCustomerID)BEGIN DECLARE @xml NVARCHAR(MAX)DECLARE @body NVARCHAR(MAX)SET @xml = CAST(( SELECT [CustomerID] AS 'td' FROM #tCustomerID ORDER BY CustomerID FOR XML PATH('tr'), ELEMENTS ) AS NVARCHAR(MAX))SET @body ='
'--SELECT @body exec msdb.dbo.sp_send_dbmail @profile_name = 'dbmailProfile' ,@recipients = 'usergroup@mydomain.com' ,@subject = 'My Valid Data Monitor' ,@body = @body ,@body_format = 'HTML'END
My Valid Data Monitor
CustomerID |
---|
Turn Up! Not every microphone has the same base volume for transmitting your voice through your computer to whoever or whatever is on the other end of the exchange. Some microphones have a higher volume as compared to others, and some microphones have a volume that is so low that the person on the other […]
The post How to Turn Up Mic Volume in Windows 10 – Appuals.com appeared first on TekPreacher.
'+@UNCPathAndLogTable+'