sqlserver job 执行时间
select instance_id,jh.run_date,jh.job_id,jh.step_name,
case jh.run_status
when 0 then 'failed'
when 1 then 'Succeeded'
when 2 then 'Retry'
when 3 then 'Canceled'
end as run_status ,left(jh.run_time,len(jh.run_time)-2) as '开始时间'
,left(run_duration,len(run_duration)-2) as '分',right(run_duration,2) as '秒',jh.run_duration,jh.run_time
from msdb.dbo.sysjobhistory jh with(nolock)
where job_id=N'1C8F16AC-5C37-4D76-883F-CD318A9E19D6' and
step_name='OUT2SAP_Without_PR' and jh.run_status=1
order by instance_id desc
select * from (select instance_id,jh.run_date,jh.job_id,jh.step_name,
case jh.run_status
when 0 then 'failed'
when 1 then 'Succeeded'
when 2 then 'Retry'
when 3 then 'Canceled'
end as run_status ,left(jh.run_time,len(jh.run_time)-2) as '开始时间'
,left(run_duration,len(run_duration)-2) as '分',right(run_duration,2) as '秒',jh.run_duration,jh.run_time
from msdb.dbo.sysjobhistory jh with(nolock)
where job_id=N'1C8F16AC-5C37-4D76-883F-CD318A9E19D6' and
step_name='OUT2SAP_Without_PR' and jh.run_status=1
--order by instance_id desc union all
select instance_id,jh.run_date,jh.job_id,jh.step_name,
case jh.run_status
when 0 then 'failed'
when 1 then 'Succeeded'
when 2 then 'Retry'
when 3 then 'Canceled'
end as run_status ,left(jh.run_time,len(jh.run_time)-2) as '开始时间'
,left(run_duration,len(run_duration)-2) as '分',right(run_duration,2) as '秒',jh.run_duration,jh.run_time
from msdb.dbo.sysjobhistory jh with(nolock)
where --job_id=N'1C8F16AC-5C37-4D76-883F-CD318A9E19D6' and
step_name='AutoOut2Sap_Without_SO' and jh.run_status=1
--order by instance_id desc ) A order by instance_id desc

sqlserver job 执行时间的更多相关文章
- 带您理解SQLSERVER是如何执行一个查询的
原文地址:http://www.cnblogs.com/lyhabc/p/3367274.html 看这篇文章之前,阁下可以先看一下下面的文章 SQLSERVER独特的任务调度算法"SQLO ...
- ClownFish:比手写代码还快的通用数据访问层
http://www.cnblogs.com/fish-li/archive/2012/07/17/ClownFish.html 阅读目录 开始 ClownFish是什么? 比手写代码还快的执行速度 ...
- SQLSERVER执行时间统计工具SQLQueryStress
有时候需要检测一下SQL语句的执行时间,相信大家都会用SET STATISTICS TIME ON开关打开SQLSERVER内置的时间统计 SET STATISTICS TIME ON 不过这款小工具 ...
- sqlserver 测试sql语句执行时间
查看sql语句执行时间/测试sql语句性能 写程序的人,往往需要分析所写的SQL语句是否已经优化过了,服务器的响应时间有多快,这个时候就需要用到SQL的STATISTICS状态值来查看了. 通过设置S ...
- sqlserver 获取存储过程执行时间
use [数据库名] select last_execution_time '最近一次执行时间' from sys.dm_exec_procedure_stats where type='P' ...
- SQLServer 查看SQL语句的执行时间
在MSSQL Server中通过查看SQL语句执行所用的时间,来衡量SQL语句的性能. 通过设置STATISTICS我们可以查看执行SQL时的系统情况.选项有PROFILE,IO ,TIME.介绍如下 ...
- 项目中调试SQLServer 方便的查看SQL语句的执行时间的方法
第一种方法,先记录执行前的时间,然后在记录执行Sql后的时间,然后做减法 1 第一种方法: 2 declare @begin_date datetime 3 declare @end_date dat ...
- sqlserver执行时间和自行效率
SET STATISTICS PROFILE ON --SET STATISTICS IO ON --SET STATISTICS TIME ON declare @dtm datetime SQL语 ...
- sqlserver检查sql执行时间
set statistics profile onset statistics io onset statistics time onGO select * from mytable; goset s ...
随机推荐
- Alpha阶段贡献分配规则
作业要求[https://edu.cnblogs.com/campus/nenu/2018fall/homework/2244] 分配规则: 1.每人有基础分3分. 2.每参加一次组内会议及活动加0. ...
- ubuntu:NVIDIA设置性能模式,以降低CPU使用、温度
NVIDIA设置性能模式,以降低CPU使用.温度 ubuntu安装完NVIDIA显卡驱动后 终端输入 nvidia-settings 选择OpenGL Settings->Image Setti ...
- CentOS7进程管理systemd详解
概述: 系统启动过程中,当内核启动完成,后加载根文件系统,后就绪的一些用户空间的服务的管理工作,就交由init进行启动和管理,在CentOS6之前的init的管理方式都类似,相关的内容我们在之前的 ...
- JQuery和Zepto的差异(部分)
1.width()/height() Zepto.js: 由盒模型(box-sizing)决定 jQuery: 忽略盒模型,始终返回内容区域的宽/高(不包含 padding.border) jQuer ...
- Swift自定义头视图和尾视图
var data: [[String]]! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup a ...
- WindowsXamlHost:在 WPF 中使用 UWP 的控件(Windows Community Toolkit)
Windows Community Toolkit 再次更新到 5.0.以前可以在 WPF 中使用有限的 UWP 控件,而现在有了 WindowsXamlHost,则可以使用更多 UWP 原生控件了. ...
- Tomcat的最大并发数
日常应用中,单台Tomcat能支持最大的并发数是多少? 作为一个有经验的Java Web开发人员对这个问题应该有大概的印象,并会让问题再具体点,比如Tomcat版本,运行模式,并发请求允许的最大响应时 ...
- wamp安装后无法正常启动(80端口被占用)
关于wamp启动是80端口被占用的问题详解(win7系统下WAMP 80端口被Microsoft-HTTPAPI/2.0占用的解决办法) VS2010在更新了SP1后,会在开机时自动启动一个服务,占用 ...
- linux shell 模拟post请求
Linux 下curl模拟Http 的get or post请求. 一.get请求 curl "http://www.baidu.com" 如果这里的URL指向的是一个文件或 ...
- springboot利用MockMvc测试controller控制器
主要记录一下控制器的测试,service这些类测试相对简单些(可测试性强) API测试需求比较简单: ① 需要返回正确的http状态码 200 ② 需要返回json数据,并且不能返回未经捕获的系统异常 ...