John Liu Blog

Every drop counts

SQL Agent Maintenance Plan

SQL Agent Maintenance Plan runs SSIS package. When troubleshooting maintenance plan job error, following query might help to view detailed error message as the job history might not contain these information. SELECT TOP 20 * FROM msdb.dbo.sysmaintplan_logdetail ORDER BY start_time DESC;

SQL Agent Job Name

At time, you might need to report the actual SQL Agent job name that took the action in your notification. For example, you have a SQL Agent job that send user an email notification and you want to include in the notification the actual job name that sends the notification. You might hardcode the job name in the notification. However, when the job renamed, you need to also remember to update the hardcoded job name in the code as well.