1

Topic: How to transform runtime JOB?

Hello!
msdb.dbo.sp_help_jobhistory returns job runtime (run_duration) in the form of an integer number. Which represents hhmmss, For example, 15332, means 1 15 32 seconds
Prompt how to convert by seconds?

2

Re: How to transform runtime JOB?

For example

declare @t int = 120235
select (@t/10000) *60*60 + (@t/100%100) *60 + @t%100

3

Re: How to transform runtime JOB?

declare @i int = 15332;
select (@i/10000), (@i/100%100), (@i%100)
select 3600 * (i/10000) + 60 * (i/100%100) + 1 * (i%100)

4

Re: How to transform runtime JOB?

Yes,  - they bright...

5

Re: How to transform runtime JOB?

The grandfather;
Thanks!!