---1. View job History
SELECT Top 1000 [instance_id]
, [job_id]
, [step_id]
, [Step_name]
, [sql_message_id]
, [sql_severity]
, [message]
, [Run_status]
, [Run_date]
, [Run_time]
, [Run_duration]
, [operator_id_emailed]
, [Operator_id_netsent]
, [operator_id_paged]
, [retries_attempted]
, [Server]
from [msdb]. [dbo]. [Sysjobhistory]
Delete from [msdb]. [dbo]. [Sysjobhistory]
---2. View Maintenance Plan Log
SELECT Top 1000 [task_detail_id]
, [plan_id]
, [subplan_id]
, [Start_time]
, [End_time]
, [succeeded]
, [logged_remotely]
, [Source_server_name]
, [Plan_name]
, [Subplan_name]
from [msdb]. [dbo]. [Sysmaintplan_log]
Delete from [msdb]. [dbo]. [Sysmaintplan_log]
---3. View Maintenance Plan Log Details
SELECT Top 1000 [task_detail_id]
, [line1]
, [Line2]
, [Line3]
, [Line4]
, [Line5]
, [server_name]
, [Start_time]
, [End_time]
, [Error_number]
, [Error_message]
, [command]
, [succeeded]
from [msdb]. [dbo]. [Sysmaintplan_logdetail]
Delete from [msdb]. [dbo]. [Sysmaintplan_logdetail]
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/SQLServer/