This
You can check the status of a SQL job and log the customized success or failure message of the job for the day in the Windows Event Viewer.
IF NOT EXISTS (SELECT TOP 1 RUN_DATE FROM MSDB.DBO.SYSJOBHISTORY WHERE JOB_ID=
(SELECT JOB_ID FROM MSDB.DBO.SYSJOBS WHERE NAME=’S_000W’) AND
STEP_ID = 3 AND RUN_STATUS=1 AND
RUN_DATE=CONVERT(VARCHAR , GETDATE(), 112) ORDER BY RUN_DATE DESC)
BEGIN
EXEC XP_LOGEVENT 60000, ‘S_000W: DAILY JOB NOT COMPLETE’, ERROR
END
ELSE
BEGIN EXEC XP_LOGEVENT 60000, ‘S_000W: DAILY JOB COMPLETED’, INFORMATIONAL
END
Usage
–xp_logevent { error_number , ‘message’ } [ , ‘severity’ ]
For more information
—http://msdn.microsoft.com/en-us/library/ms186244.aspx
Also check the uses RAISERROR
For other #JustLearned check the below links
SQL Server Tips – Identify running jobs on remote server