SQL Server作业信息和作业的调度控制简析
来源:未知 责任编辑:责任编辑 发表时间:2013-11-26 22:15 点击:次
SQL Server作业信息和作业的调度控制简析
一、作业基本信息
[sql]
select a.name 'Job名称',a.[description] 作业描述,
作业创建时间=a.date_created,
上次修改作业时间=a.date_modified,
下一次运行日期=substring(ltrim(b.next_run_date),1,4)+'-' + substring(ltrim(b.next_run_date),5,2)+'-' + right(ltrim(b.next_run_date),2),
下一次运行时间=substring(right('000000'+convert(varchar,b.next_run_time),6),1,2)+':' + substring(right('000000'+convert(varchar,b.next_run_time),6),3,2) +':' + + substring(right('000000'+convert(varchar,b.next_run_time),6),5,2),
case when (c.freq_type=4 and c.freq_subday_type=4) then ('每'+convert(varchar,c.freq_subday_interval)+'分钟') www.2cto.com
when (c.freq_type=4 and c.freq_subday_type=8) then ('每'+convert(varchar,c.freq_subday_interval)+'小时')
when (c.freq_type=4 and c.freq_subday_type=1) then ('每天一次:' + substring(right('000000'+convert(varchar,active_start_time),6),1,2)+':' + substring(right('000000'+convert(varchar,active_start_time),6),3,2) +':' + + substring(right('000000'+convert(varchar,active_start_time),6),5,2) )
when (c.freq_type=8 and c.freq_interval=1 and c.freq_subday_type=1) then ('每星期天:' + right('000000'+convert(varchar,active_start_time),6) )
when (c.freq_type=8 and c.freq_interval=2 and c.freq_subday_type=1) then ('每星期一:' + right('000000'+convert(varchar,active_start_time),6) )
when (c.freq_type=8 and c.freq_interval=4 and c.freq_subday_type=1) then ('每星期二:' + right('000000'+convert(varchar,active_start_time),6) )
when (c.freq_type=8 and c.freq_interval=8 and c.freq_subday_type=1) then ('每星期三:' + right('000000'+convert(varchar,active_start_time),6) )
when (c.freq_type=8 and c.freq_interval=16 and c.freq_subday_type=1) then ('每星期四:' + right('000000'+convert(varchar,active_start_time),6) )
when (c.freq_type=8 and c.freq_interval=32 and c.freq_subday_type=1) then ('每星期五:' + right('000000'+convert(varchar,active_start_time),6) )
when (c.freq_type=8 and c.freq_interval=64 and c.freq_subday_type=1) then ('每星期六:' + right('000000'+convert(varchar,active_start_time),6) )
when (c.freq_type=8 and c.freq_interval=1 and c.freq_subday_type=8) then ('每星期天:每' +convert(varchar,c.freq_subday_interval)+'小时')
else '未知' end +' 开始执行' '频率',
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>