分类: SQLServer
2013-11-06 12:03:37
原文地址:SQLServer:SQL中JOB的运行状态 作者:hnynes
and jc.category_id not between 10 and 20 -- repl
/*
category_id name
0 [Uncategorized (Local)]
1 Jobs from MSX
2 [Uncategorized (Multi-Server)]
3 Database Maintenance
4 Web Assistant
5 Full-Text
6 Log Shipping
7 Database Engine Tuning Advisor
10 REPL-Distribution
11 REPL-Distribution Cleanup
12 REPL-History Cleanup
13 REPL-LogReader
14 REPL-Merge
15 REPL-Snapshot
16 REPL-Checkup
17 REPL-Subscription Cleanup
18 REPL-Alert Response
19 REPL-QueueReader
20 Replication
98 [Uncategorized]
99 [Uncategorized]
*/
select run_status,a.run_time, a.* from msdb.dbo.sysjobhistory a inner join msdb.dbo.sysjobs b on a.job_id=b.job_id where b.name='作业名'作业的执行状态run_status: 0 = 失败1 = 成功2 = 重试3 = 取消4 = 正在进行。
原文地址:
http://blog.csdn.net/chenghaibing2008/article/details/6064714