Total of records per set of seconds

  • I'm trying to find a faster way to get a total of records in my table per second.

    I have a table with information where I know what time start a Job and what time a Job is End. I need to know how many Jobs were produced per second.

    I did this query, but for 24hrs calculation, takes around 10minutes.

    DECLARE @seconds INT

    ,@StartDate datetime

    ,@EndDate DATETIME

    ,@InitialDATETIME

    , @TimeDATETIME

    SET @Initial = '2010-06-04 00:00:00'

    SET @StartDate = '2010-06-04 00:00:00'

    SET @EndDate = '2010-06-04 23:59:59'

    set @seconds = 1

    CREATE TABLE #Stats

    (

    TimeOfDayDATETIME

    ,TotalJobsINT

    )

    While @Initial <= @EndDate

    Begin

    SET @Time = dateadd(ss, @Seconds, @StartDate)

    Insert #Stats

    -- Selectdateadd(ss, @Seconds, @StartDate) 'NumJobs'

    SELECT @Time, count(*)

    FROMcps_subjobs with(NOLOCK)

    WHEREsubJobTypeId IN (19, 21)

    AND[Started] <= @Time AND [finished] >= @Time

    set @Initial = dateadd(ss, @Seconds, @StartDate )

    set @seconds = @seconds + 1

    END

    SELECT * FROM #Stats ORDER BY TimeOfDay

    DROP TABLE #Stats

    Is anyway to do it faster?

  • You need a list of the seconds in a time period, and how many jobs were in progress during each second, right?

    I recommend using a Numbers table instead of a loop, to get all the seconds.

    Do a search on this site for Numbers and Tally tables, and you'll find efficient solutions.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • GSquared (11/4/2010)


    You need a list of the seconds in a time period, and how many jobs were in progress during each second, right?

    I recommend using a Numbers table instead of a loop, to get all the seconds.

    Do a search on this site for Numbers and Tally tables, and you'll find efficient solutions.

    Agreed - if this assumption is incorrect, then please provide the table structure for the cpu table and some sample data.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Taking what GSquared and Jason suggested, try this out and see how it works for you.

    SET @Seconds = DATEDIFF(second, @StartDate, @EndDate);

    WITH CTE AS

    (

    SELECT TimeOfDay = DATEADD(second, N, @StartDate)

    FROM dbo.TALLY

    WHERE N <= @Seconds

    )

    SELECT CTE.TimeOfDay,

    TotalJobs = COUNT(*)

    FROM cps_subjobs c

    JOIN CTE

    ON c.Started <= CTE.TimeOfDay

    AND c.finished >= CTE.TimeOfDay

    WHERE c.subJobTypeId IN (19,21)

    GROUP BY CTE.TimeOfDay

    ORDER BY CTE.TimeOfDay;

    Since there is no DDL/DML to test against, this might not work. To get a tested solution, please see the first link in my signature.

    Not sure what a tally table is? See The "Numbers" or "Tally" Table: What it is and how it replaces a loop.[/url]

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • You need a list of the seconds in a time period, and how many jobs were in progress during each second, right?

    YES

    I did this but still take a long time.. what Im missing?

    CREATE TABLE #Tally

    (

    N INT

    CONSTRAINT PK_Tally_N PRIMARY KEY CLUSTERED (N)

    )

    DECLARE @seconds INT

    ,@StartDate datetime

    ,@EndDate DATETIME

    ,@InitialDATETIME

    ,@CounterINT

    --SET @Initial = '2010-06-04 00:00:00'

    SET @StartDate = '2010-06-04 00:00:00'

    SET @EndDate = '2010-06-04 23:59:59'

    SET @Counter = 1

    set @seconds = 1

    WHILE @Counter <= 86400 -- 24 hours

    BEGIN

    INSERT INTO #Tally

    VALUES (@Counter)

    SET @Counter = @Counter + 1

    END

    SET @Seconds = DATEDIFF(second, @StartDate, @EndDate);

    WITH CTE AS

    (

    SELECT TimeOfDay = DATEADD(second, n, @StartDate)

    FROM #Tally

    WHERE n <= @Seconds

    )

    SELECTCTE.TimeOfDay, TotalJobs = COUNT(*)

    FROMcps_subjobs c

    JOINCTE ON c.Started <= CTE.TimeOfDay

    ANDc.finished >= CTE.TimeOfDay

    WHEREc.subJobTypeId IN (19,21)

    GROUP BY CTE.TimeOfDay

    ORDER BY CTE.TimeOfDay;

    --DROP TABLE #Stats

    DROP TABLE #Tally

  • Alternately, if you don't have a Tally table in place, try this:

    DECLARE

    @SDateTime DATETIME,

    @EDateTime DATETIME ;

    SELECT

    @SDateTime = '11/4/10',

    @EDateTime = GETDATE() ;

    ;

    WITH Numbers(Number)

    AS (SELECT TOP 1000001

    ROW_NUMBER() OVER (ORDER BY S1.OBJECT_ID) - 1

    FROM

    sys.columns AS S1

    CROSS JOIN sys.columns AS S2) ,

    Times(TSec)

    AS (SELECT

    DATEADD(SECOND, Number, @SDateTime)

    FROM

    Numbers

    WHERE

    Number BETWEEN 0

    AND DATEDIFF(SECOND, @SDateTime, @EDateTime))

    SELECT

    TSec AS [Time],

    count(*)

    FROM

    dbo.cps_subjobs AS Jobs

    INNER JOIN Times

    ON [Started] <= TSec

    AND [finished] >= TSec

    WHERE

    subJobTypeId IN (19, 21)

    GROUP BY

    TSec

    ORDER BY

    TSec ;

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • You are still building the tally table Row-By-Agonizing-Row (RBAR).

    It would be better to do it in a set-based fashion, such as is described in the article that I referenced in my last post.

    It would be wise to NOT name your Primary Key Constraint on the #temp table. If another process tries to run this (or another process that you create after this, with the same style), you will end up with the second process getting a duplicate constraint name violation error in the sys.objects table.

    It would also be wise to just create the tally table as a permanent table, with a suitable number of sequential numbers to suit your needs. 86400 is definitely a good starting point; you might want to consider 100,000 or higher. This will save you from having to build it every time you run this process.

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • I want to run a test first to see how "fast" it can show the result. I tried both options, but it is still slow.

    i used the Tally table and I used the query that GSquared post... and both are slow... I dont know what Im missing 🙁

  • Please provide us the DDL and sample data. We can't legitimately test a solution without knowing this information.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • WayneS (11/4/2010)


    It would also be wise to just create the tally table as a permanent table, with a suitable number of sequential numbers to suit your needs. 86400 is definitely a good starting point; you might want to consider 100,000 or higher. This will save you from having to build it every time you run this process.

    Sometimes it is more efficient to rebuild the tally table each time. I would say that the wise choice would be to test it both ways and determine which way would be faster for your needs.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Okay... Im working on SQL Server 2005 and this will be the result sample that I need:

    note: I only compare one minute of my entire table, but i will need to show from second 1 the total of 0 Jobs (in case if there is not job in that second)...... below you will see the table scheme and the insertion values of the table as well.

    TimeTotalJobs

    2010-06-04 17:10:00.0001

    2010-06-04 17:10:01.0001

    2010-06-04 17:10:02.0001

    2010-06-04 17:10:03.0001

    2010-06-04 17:10:04.0001

    2010-06-04 17:10:05.0002

    2010-06-04 17:10:06.0002

    2010-06-04 17:10:07.0002

    2010-06-04 17:10:08.0002

    2010-06-04 17:10:09.0002

    2010-06-04 17:10:10.0002

    2010-06-04 17:10:11.0001

    2010-06-04 17:10:12.0002

    2010-06-04 17:10:13.0002

    2010-06-04 17:10:14.0002

    2010-06-04 17:10:15.0001

    2010-06-04 17:10:16.0001

    2010-06-04 17:10:17.0001

    2010-06-04 17:10:18.0001

    2010-06-04 17:10:19.0002

    2010-06-04 17:10:20.0003

    2010-06-04 17:10:21.0003

    2010-06-04 17:10:22.0002

    2010-06-04 17:10:23.0002

    2010-06-04 17:10:24.0002

    2010-06-04 17:10:25.0002

    2010-06-04 17:10:26.0002

    2010-06-04 17:10:27.0002

    2010-06-04 17:10:28.0002

    2010-06-04 17:10:29.0002

    2010-06-04 17:10:30.0001

    2010-06-04 17:10:31.0001

    2010-06-04 17:10:32.0001

    2010-06-04 17:10:33.0002

    2010-06-04 17:10:34.0002

    2010-06-04 17:10:35.0002

    2010-06-04 17:10:36.0002

    2010-06-04 17:10:37.0001

    2010-06-04 17:10:38.0001

    2010-06-04 17:10:39.0001

    2010-06-04 17:10:40.0001

    2010-06-04 17:10:41.0002

    2010-06-04 17:10:42.0002

    2010-06-04 17:10:43.0001

    2010-06-04 17:10:44.0001

    2010-06-04 17:10:45.0001

    2010-06-04 17:10:46.0002

    2010-06-04 17:10:47.0002

    2010-06-04 17:10:48.0002

    2010-06-04 17:10:49.0002

    2010-06-04 17:10:50.0002

    2010-06-04 17:10:51.0002

    2010-06-04 17:10:52.0002

    2010-06-04 17:10:53.0002

    2010-06-04 17:10:54.0002

    2010-06-04 17:10:55.0002

    2010-06-04 17:10:56.0001

    2010-06-04 17:10:57.0001

    2010-06-04 17:10:58.0001

    2010-06-04 17:10:59.0002

    2010-06-04 17:11:00.0002

    TABLE SCHEME

    CREATE TABLE [dbo].[SubJobs](

    [subjobid] [int] IDENTITY(1,1) NOT NULL,

    [Started] [datetime] NULL,

    [finished] [datetime] NULL

    ) ON [PRIMARY]

    DATA IN THE TABLE

    SET IDENTITY_INSERT [dbo].[SubJobs] ON

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019407, '2010-06-04 10:30:54.000', '2010-06-04 10:32:02.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019604, '2010-06-04 10:32:39.000', '2010-06-04 10:33:47.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019609, '2010-06-04 10:34:17.000', '2010-06-04 10:35:29.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019610, '2010-06-04 10:35:54.000', '2010-06-04 10:37:09.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019611, '2010-06-04 10:37:16.000', '2010-06-04 10:38:22.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019612, '2010-06-04 10:37:52.000', '2010-06-04 10:39:49.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019613, '2010-06-04 10:38:35.000', '2010-06-04 10:38:46.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019614, '2010-06-04 10:39:31.000', '2010-06-04 10:39:42.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019615, '2010-06-04 10:39:54.000', '2010-06-04 10:40:05.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019616, '2010-06-04 10:40:28.000', '2010-06-04 10:40:39.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019617, '2010-06-04 10:40:50.000', '2010-06-04 10:41:01.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019618, '2010-06-04 10:42:37.000', '2010-06-04 10:42:48.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019619, '2010-06-04 10:43:06.000', '2010-06-04 10:43:49.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019620, '2010-06-04 10:44:04.000', '2010-06-04 10:44:15.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019621, '2010-06-04 10:44:31.000', '2010-06-04 10:45:11.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019622, '2010-06-04 10:45:26.000', '2010-06-04 10:45:37.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019623, '2010-06-04 10:45:58.000', '2010-06-04 10:46:38.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019624, '2010-06-04 10:46:45.000', '2010-06-04 10:46:56.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019625, '2010-06-04 10:47:26.000', '2010-06-04 10:48:07.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019626, '2010-06-04 10:48:35.000', '2010-06-04 10:48:46.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019627, '2010-06-04 10:49:00.000', '2010-06-04 10:49:38.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019628, '2010-06-04 10:49:51.000', '2010-06-04 10:50:02.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019629, '2010-06-04 10:50:27.000', '2010-06-04 10:51:10.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019630, '2010-06-04 10:51:17.000', '2010-06-04 10:51:28.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019631, '2010-06-04 10:51:49.000', '2010-06-04 10:52:29.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019632, '2010-06-04 10:52:39.000', '2010-06-04 10:52:50.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019633, '2010-06-04 10:53:03.000', '2010-06-04 10:53:43.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019708, '2010-06-04 10:54:03.000', '2010-06-04 10:54:14.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019958, '2010-06-04 10:56:14.000', '2010-06-04 10:56:54.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2019965, '2010-06-04 10:57:05.000', '2010-06-04 10:57:16.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020038, '2010-06-04 10:57:35.000', '2010-06-04 10:58:22.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020122, '2010-06-04 10:58:38.000', '2010-06-04 10:58:49.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020276, '2010-06-04 11:02:14.000', '2010-06-04 11:03:44.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020285, '2010-06-04 11:02:43.000', '2010-06-04 11:05:07.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020293, '2010-06-04 11:03:53.000', '2010-06-04 11:04:58.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020294, '2010-06-04 11:03:55.000', '2010-06-04 11:04:34.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020295, '2010-06-04 11:04:24.000', '2010-06-04 11:04:37.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020296, '2010-06-04 11:05:11.000', '2010-06-04 11:05:47.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020297, '2010-06-04 11:05:14.000', '2010-06-04 11:10:00.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020298, '2010-06-04 11:05:42.000', '2010-06-04 11:05:52.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020299, '2010-06-04 11:05:48.000', '2010-06-04 11:05:56.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020300, '2010-06-04 11:06:50.000', '2010-06-04 11:07:02.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020301, '2010-06-04 11:16:31.000', '2010-06-04 11:16:40.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020302, '2010-06-04 11:16:37.000', '2010-06-04 11:16:49.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020444, '2010-06-04 11:25:54.000', '2010-06-04 11:26:02.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020656, '2010-06-04 11:50:41.000', '2010-06-04 11:52:08.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020717, '2010-06-04 11:55:25.000', '2010-06-04 11:55:36.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020754, '2010-06-04 11:57:10.000', '2010-06-04 12:14:44.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020805, '2010-06-04 12:15:57.000', '2010-06-04 12:17:04.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020855, '2010-06-04 12:17:08.000', '2010-06-04 12:17:17.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020912, '2010-06-04 12:35:18.000', '2010-06-04 12:35:37.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020913, '2010-06-04 12:18:24.000', '2010-06-04 12:18:30.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2020914, '2010-06-04 12:18:29.000', '2010-06-04 12:18:37.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2021272, '2010-06-04 12:51:15.000', '2010-06-04 12:52:23.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2021273, '2010-06-04 12:51:22.000', '2010-06-04 12:53:38.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2021275, '2010-06-04 12:52:39.000', '2010-06-04 12:52:49.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2021434, '2010-06-04 12:54:23.000', '2010-06-04 12:54:36.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2021461, '2010-06-04 12:54:59.000', '2010-06-04 13:05:50.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022390, '2010-06-04 13:13:30.000', '2010-06-04 13:14:40.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022402, '2010-06-04 13:13:45.000', '2010-06-04 13:16:00.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022403, '2010-06-04 13:14:01.000', '2010-06-04 13:19:01.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022404, '2010-06-04 13:15:45.000', '2010-06-04 13:15:55.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022405, '2010-06-04 13:16:13.000', '2010-06-04 13:16:26.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022406, '2010-06-04 13:20:27.000', '2010-06-04 13:20:50.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022408, '2010-06-04 13:25:14.000', '2010-06-04 13:25:35.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022409, '2010-06-04 13:25:45.000', '2010-06-04 13:26:08.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022410, '2010-06-04 13:26:24.000', '2010-06-04 13:26:48.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022411, '2010-06-04 13:27:14.000', '2010-06-04 13:27:38.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022412, '2010-06-04 13:27:52.000', '2010-06-04 13:28:15.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022413, '2010-06-04 13:28:27.000', '2010-06-04 13:28:53.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022414, '2010-06-04 13:28:52.000', '2010-06-04 13:33:58.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022428, '2010-06-04 13:29:59.000', '2010-06-04 13:30:28.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022442, '2010-06-04 13:30:39.000', '2010-06-04 13:31:03.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022444, '2010-06-04 13:33:33.000', '2010-06-04 13:33:59.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022458, '2010-06-04 13:34:11.000', '2010-06-04 13:34:34.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022465, '2010-06-04 13:34:47.000', '2010-06-04 13:35:08.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022469, '2010-06-04 13:35:36.000', '2010-06-04 13:36:02.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022546, '2010-06-04 13:36:24.000', '2010-06-04 13:36:33.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022638, '2010-06-04 13:37:15.000', '2010-06-04 13:37:24.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022686, '2010-06-04 13:37:38.000', '2010-06-04 13:37:46.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022694, '2010-06-04 13:38:28.000', '2010-06-04 13:38:37.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022763, '2010-06-04 13:40:05.000', '2010-06-04 13:40:13.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2022820, '2010-06-04 13:41:14.000', '2010-06-04 13:41:23.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023006, '2010-06-04 13:44:48.000', '2010-06-04 13:44:56.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023348, '2010-06-04 13:47:12.000', '2010-06-04 13:47:21.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023358, '2010-06-04 13:47:34.000', '2010-06-04 13:47:43.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023367, '2010-06-04 13:48:05.000', '2010-06-04 13:48:14.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023368, '2010-06-04 13:48:13.000', '2010-06-04 13:53:17.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023369, '2010-06-04 13:48:27.000', '2010-06-04 13:48:36.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023420, '2010-06-04 13:49:55.000', '2010-06-04 13:50:05.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023486, '2010-06-04 13:50:35.000', '2010-06-04 13:50:54.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023550, '2010-06-04 13:53:52.000', '2010-06-04 13:55:07.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023615, '2010-06-04 13:56:12.000', '2010-06-04 13:56:22.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023775, '2010-06-04 13:57:38.000', '2010-06-04 14:01:14.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023829, '2010-06-04 13:59:19.000', '2010-06-04 13:59:41.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023830, '2010-06-04 14:00:28.000', '2010-06-04 14:02:53.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023831, '2010-06-04 14:02:21.000', '2010-06-04 14:02:33.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023832, '2010-06-04 14:02:19.000', '2010-06-04 14:02:31.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023833, '2010-06-04 14:02:28.000', '2010-06-04 14:02:32.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023834, '2010-06-04 14:02:57.000', '2010-06-04 14:03:08.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023835, '2010-06-04 14:03:04.000', '2010-06-04 14:03:17.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023915, '2010-06-04 14:11:15.000', '2010-06-04 14:12:06.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023916, '2010-06-04 14:12:46.000', '2010-06-04 14:15:57.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2023980, '2010-06-04 14:43:24.000', '2010-06-04 14:44:59.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024014, '2010-06-04 14:47:44.000', '2010-06-04 14:47:56.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024015, '2010-06-04 14:47:52.000', '2010-06-04 14:48:38.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024016, '2010-06-04 14:51:44.000', '2010-06-04 14:52:26.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024017, '2010-06-04 14:52:28.000', '2010-06-04 14:52:36.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024018, '2010-06-04 14:52:38.000', '2010-06-04 14:53:28.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024019, '2010-06-04 14:54:27.000', '2010-06-04 14:55:19.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024020, '2010-06-04 14:56:04.000', '2010-06-04 14:56:52.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024021, '2010-06-04 14:57:07.000', '2010-06-04 14:58:00.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024022, '2010-06-04 14:59:13.000', '2010-06-04 14:59:23.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024023, '2010-06-04 14:59:11.000', '2010-06-04 14:59:21.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024024, '2010-06-04 14:59:18.000', '2010-06-04 14:59:22.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024025, '2010-06-04 14:59:16.000', '2010-06-04 14:59:26.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024026, '2010-06-04 14:59:21.000', '2010-06-04 14:59:31.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024027, '2010-06-04 14:59:23.000', '2010-06-04 14:59:33.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024028, '2010-06-04 15:01:41.000', '2010-06-04 15:02:37.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024029, '2010-06-04 15:02:51.000', '2010-06-04 15:03:35.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024030, '2010-06-04 15:03:59.000', '2010-06-04 15:04:47.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024031, '2010-06-04 15:04:44.000', '2010-06-04 15:04:55.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024032, '2010-06-04 15:05:18.000', '2010-06-04 15:08:22.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024033, '2010-06-04 15:08:43.000', '2010-06-04 15:08:56.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024034, '2010-06-04 15:10:12.000', '2010-06-04 15:11:02.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024035, '2010-06-04 15:11:11.000', '2010-06-04 15:12:08.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024036, '2010-06-04 15:13:09.000', '2010-06-04 15:13:19.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024037, '2010-06-04 15:13:12.000', '2010-06-04 15:13:21.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024038, '2010-06-04 15:13:13.000', '2010-06-04 15:13:23.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024039, '2010-06-04 15:13:15.000', '2010-06-04 15:13:25.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024040, '2010-06-04 15:13:20.000', '2010-06-04 15:13:28.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024041, '2010-06-04 15:15:23.000', '2010-06-04 15:15:51.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024042, '2010-06-04 15:16:01.000', '2010-06-04 15:16:25.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024043, '2010-06-04 15:17:22.000', '2010-06-04 15:17:45.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024044, '2010-06-04 15:17:58.000', '2010-06-04 15:18:19.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024045, '2010-06-04 15:18:28.000', '2010-06-04 15:18:54.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024167, '2010-06-04 15:24:26.000', '2010-06-04 15:24:48.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024168, '2010-06-04 15:26:27.000', '2010-06-04 15:26:34.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024169, '2010-06-04 15:26:30.000', '2010-06-04 15:26:39.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024170, '2010-06-04 15:26:32.000', '2010-06-04 15:26:41.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024171, '2010-06-04 15:26:35.000', '2010-06-04 15:26:41.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024172, '2010-06-04 15:26:41.000', '2010-06-04 15:26:50.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024173, '2010-06-04 15:26:43.000', '2010-06-04 15:26:50.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024174, '2010-06-04 15:29:08.000', '2010-06-04 15:29:27.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024180, '2010-06-04 15:30:44.000', '2010-06-04 15:31:26.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024182, '2010-06-04 15:30:53.000', '2010-06-04 15:31:35.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024183, '2010-06-04 15:30:56.000', '2010-06-04 15:31:26.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024184, '2010-06-04 15:31:04.000', '2010-06-04 15:31:33.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024185, '2010-06-04 15:31:27.000', '2010-06-04 15:31:57.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024186, '2010-06-04 15:31:27.000', '2010-06-04 15:31:57.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024187, '2010-06-04 15:31:33.000', '2010-06-04 15:32:02.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024188, '2010-06-04 15:31:36.000', '2010-06-04 15:32:06.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024189, '2010-06-04 15:31:58.000', '2010-06-04 15:32:27.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024190, '2010-06-04 15:31:58.000', '2010-06-04 15:32:28.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024191, '2010-06-04 15:32:02.000', '2010-06-04 15:32:33.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024192, '2010-06-04 15:32:16.000', '2010-06-04 15:32:44.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024193, '2010-06-04 15:32:28.000', '2010-06-04 15:32:58.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024194, '2010-06-04 15:32:35.000', '2010-06-04 15:33:03.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024195, '2010-06-04 15:32:41.000', '2010-06-04 15:33:30.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024196, '2010-06-04 15:32:51.000', '2010-06-04 15:33:35.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024197, '2010-06-04 15:32:59.000', '2010-06-04 15:33:28.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024198, '2010-06-04 15:33:05.000', '2010-06-04 15:33:33.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024199, '2010-06-04 15:33:29.000', '2010-06-04 15:34:12.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024200, '2010-06-04 15:33:30.000', '2010-06-04 15:33:59.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024201, '2010-06-04 15:33:34.000', '2010-06-04 15:34:02.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024202, '2010-06-04 15:33:36.000', '2010-06-04 15:34:04.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024203, '2010-06-04 15:33:59.000', '2010-06-04 15:34:23.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024204, '2010-06-04 15:34:03.000', '2010-06-04 15:34:29.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024205, '2010-06-04 15:34:55.000', '2010-06-04 15:35:45.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024206, '2010-06-04 15:35:57.000', '2010-06-04 15:36:03.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024207, '2010-06-04 15:36:50.000', '2010-06-04 15:38:08.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024208, '2010-06-04 15:37:56.000', '2010-06-04 15:44:57.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024209, '2010-06-04 15:37:58.000', '2010-06-04 15:38:09.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024210, '2010-06-04 15:38:19.000', '2010-06-04 15:38:29.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024211, '2010-06-04 15:38:26.000', '2010-06-04 15:38:35.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024212, '2010-06-04 15:41:58.000', '2010-06-04 15:42:05.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024213, '2010-06-04 15:42:14.000', '2010-06-04 15:42:21.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024214, '2010-06-04 15:42:33.000', '2010-06-04 15:42:42.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024215, '2010-06-04 15:42:43.000', '2010-06-04 15:42:49.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024216, '2010-06-04 15:43:21.000', '2010-06-04 15:43:27.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024217, '2010-06-04 15:43:36.000', '2010-06-04 15:43:42.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024218, '2010-06-04 15:43:46.000', '2010-06-04 15:43:52.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024220, '2010-06-04 15:44:11.000', '2010-06-04 15:44:17.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024221, '2010-06-04 15:44:43.000', '2010-06-04 15:44:49.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024222, '2010-06-04 15:44:58.000', '2010-06-04 15:45:04.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024223, '2010-06-04 15:45:12.000', '2010-06-04 15:45:18.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024224, '2010-06-04 15:45:26.000', '2010-06-04 15:45:32.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024225, '2010-06-04 15:45:40.000', '2010-06-04 15:45:46.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024226, '2010-06-04 15:45:54.000', '2010-06-04 15:46:00.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024242, '2010-06-04 15:46:28.000', '2010-06-04 15:46:49.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024245, '2010-06-04 15:46:11.000', '2010-06-04 15:46:22.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024247, '2010-06-04 15:46:21.000', '2010-06-04 15:46:29.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024248, '2010-06-04 15:46:35.000', '2010-06-04 15:46:41.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024249, '2010-06-04 15:46:39.000', '2010-06-04 15:51:29.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024250, '2010-06-04 15:46:51.000', '2010-06-04 15:46:58.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024252, '2010-06-04 15:47:06.000', '2010-06-04 15:47:13.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024253, '2010-06-04 15:47:22.000', '2010-06-04 15:47:31.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024254, '2010-06-04 15:47:31.000', '2010-06-04 15:47:39.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024391, '2010-06-04 15:54:33.000', '2010-06-04 15:55:29.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024396, '2010-06-04 15:55:38.000', '2010-06-04 15:55:47.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024412, '2010-06-04 15:59:55.000', '2010-06-04 16:03:29.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024777, '2010-06-04 16:11:31.000', '2010-06-04 16:12:12.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024778, '2010-06-04 16:12:41.000', '2010-06-04 16:13:21.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024779, '2010-06-04 16:12:45.000', '2010-06-04 16:12:52.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2024780, '2010-06-04 16:12:57.000', '2010-06-04 16:13:10.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025342, '2010-06-04 16:26:01.000', '2010-06-04 16:26:10.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025347, '2010-06-04 16:25:48.000', '2010-06-04 16:26:19.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025409, '2010-06-04 16:32:23.000', '2010-06-04 16:34:16.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025452, '2010-06-04 16:36:35.000', '2010-06-04 16:36:43.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025454, '2010-06-04 16:39:55.000', '2010-06-04 16:40:09.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025455, '2010-06-04 16:40:06.000', '2010-06-04 16:40:35.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025457, '2010-06-04 16:40:33.000', '2010-06-04 16:42:34.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025458, '2010-06-04 16:41:13.000', '2010-06-04 16:41:20.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025459, '2010-06-04 16:42:03.000', '2010-06-04 16:42:10.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025460, '2010-06-04 16:42:52.000', '2010-06-04 16:43:03.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025481, '2010-06-04 16:50:22.000', '2010-06-04 16:50:46.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025482, '2010-06-04 16:50:38.000', '2010-06-04 16:51:14.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025483, '2010-06-04 16:51:00.000', '2010-06-04 16:51:30.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025484, '2010-06-04 16:51:11.000', '2010-06-04 16:51:37.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025485, '2010-06-04 16:51:21.000', '2010-06-04 16:51:47.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025486, '2010-06-04 16:51:39.000', '2010-06-04 16:52:11.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025487, '2010-06-04 16:51:54.000', '2010-06-04 16:52:24.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025492, '2010-06-04 16:52:04.000', '2010-06-04 16:52:43.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025499, '2010-06-04 16:52:14.000', '2010-06-04 16:52:50.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025510, '2010-06-04 16:52:31.000', '2010-06-04 16:52:58.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025529, '2010-06-04 16:52:40.000', '2010-06-04 16:53:11.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025561, '2010-06-04 16:53:02.000', '2010-06-04 16:53:49.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025580, '2010-06-04 16:53:17.000', '2010-06-04 16:54:12.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025595, '2010-06-04 16:53:21.000', '2010-06-04 16:54:12.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025599, '2010-06-04 16:53:26.000', '2010-06-04 16:54:15.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025616, '2010-06-04 16:53:50.000', '2010-06-04 16:54:19.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025639, '2010-06-04 16:54:17.000', '2010-06-04 16:54:41.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025754, '2010-06-04 16:55:50.000', '2010-06-04 16:56:41.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025755, '2010-06-04 16:56:20.000', '2010-06-04 16:56:52.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025756, '2010-06-04 16:56:54.000', '2010-06-04 16:57:31.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025757, '2010-06-04 16:57:04.000', '2010-06-04 16:57:31.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025758, '2010-06-04 16:57:10.000', '2010-06-04 16:57:54.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025759, '2010-06-04 16:57:16.000', '2010-06-04 16:57:52.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025760, '2010-06-04 16:57:31.000', '2010-06-04 16:58:06.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025761, '2010-06-04 16:57:46.000', '2010-06-04 16:58:37.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025783, '2010-06-04 17:08:50.000', '2010-06-04 17:08:59.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025784, '2010-06-04 17:08:56.000', '2010-06-04 17:09:05.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025797, '2010-06-04 17:09:02.000', '2010-06-04 17:09:11.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025799, '2010-06-04 17:09:10.000', '2010-06-04 17:09:21.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025804, '2010-06-04 17:09:16.000', '2010-06-04 17:09:25.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025805, '2010-06-04 17:09:21.000', '2010-06-04 17:09:30.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025806, '2010-06-04 17:09:31.000', '2010-06-04 17:09:40.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025808, '2010-06-04 17:09:36.000', '2010-06-04 17:09:45.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025823, '2010-06-04 17:09:46.000', '2010-06-04 17:09:55.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025826, '2010-06-04 17:10:19.000', '2010-06-04 17:10:26.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025828, '2010-06-04 17:09:59.000', '2010-06-04 17:10:10.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025830, '2010-06-04 17:10:05.000', '2010-06-04 17:10:14.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025833, '2010-06-04 17:10:12.000', '2010-06-04 17:10:21.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025834, '2010-06-04 17:10:20.000', '2010-06-04 17:10:29.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025836, '2010-06-04 17:10:27.000', '2010-06-04 17:10:36.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025837, '2010-06-04 17:10:33.000', '2010-06-04 17:10:42.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025838, '2010-06-04 17:10:41.000', '2010-06-04 17:10:50.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025840, '2010-06-04 17:10:46.000', '2010-06-04 17:10:55.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025845, '2010-06-04 17:10:51.000', '2010-06-04 17:11:00.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025861, '2010-06-04 17:10:59.000', '2010-06-04 17:11:08.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025862, '2010-06-04 17:11:04.000', '2010-06-04 17:11:13.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025865, '2010-06-04 17:11:11.000', '2010-06-04 17:11:20.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025866, '2010-06-04 17:11:16.000', '2010-06-04 17:11:25.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025869, '2010-06-04 17:11:32.000', '2010-06-04 17:12:02.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025870, '2010-06-04 17:11:39.000', '2010-06-04 17:11:48.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2025873, '2010-06-04 17:12:12.000', '2010-06-04 17:12:21.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026242, '2010-06-04 17:26:48.000', '2010-06-04 17:27:46.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026261, '2010-06-04 17:27:54.000', '2010-06-04 17:28:51.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026283, '2010-06-04 17:29:01.000', '2010-06-04 17:30:02.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026324, '2010-06-04 17:30:18.000', '2010-06-04 17:31:15.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026330, '2010-06-04 17:31:37.000', '2010-06-04 17:32:13.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026331, '2010-06-04 17:32:14.000', '2010-06-04 17:32:39.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026332, '2010-06-04 17:32:40.000', '2010-06-04 17:33:04.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026333, '2010-06-04 17:33:05.000', '2010-06-04 17:33:23.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026334, '2010-06-04 17:33:26.000', '2010-06-04 17:33:44.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026335, '2010-06-04 17:33:45.000', '2010-06-04 17:34:03.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026338, '2010-06-04 17:35:25.000', '2010-06-04 17:36:35.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026339, '2010-06-04 17:35:42.000', '2010-06-04 17:36:06.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026352, '2010-06-04 17:36:07.000', '2010-06-04 17:36:32.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026360, '2010-06-04 17:36:33.000', '2010-06-04 17:36:54.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026370, '2010-06-04 17:36:57.000', '2010-06-04 17:37:08.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026378, '2010-06-04 17:37:02.000', '2010-06-04 17:37:13.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026383, '2010-06-04 17:37:04.000', '2010-06-04 17:37:15.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026389, '2010-06-04 17:37:07.000', '2010-06-04 17:37:16.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026394, '2010-06-04 17:37:10.000', '2010-06-04 17:37:21.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026402, '2010-06-04 17:37:13.000', '2010-06-04 17:37:30.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026432, '2010-06-04 17:37:31.000', '2010-06-04 17:37:50.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026456, '2010-06-04 17:37:50.000', '2010-06-04 17:38:09.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026473, '2010-06-04 17:39:00.000', '2010-06-04 17:39:19.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026537, '2010-06-04 17:40:12.000', '2010-06-04 17:44:18.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026545, '2010-06-04 17:39:49.000', '2010-06-04 17:40:11.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026568, '2010-06-04 17:45:00.000', '2010-06-04 17:45:16.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026569, '2010-06-04 17:45:17.000', '2010-06-04 17:45:35.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026570, '2010-06-04 17:45:36.000', '2010-06-04 17:45:56.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026586, '2010-06-04 17:46:07.000', '2010-06-04 17:46:25.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026594, '2010-06-04 17:47:16.000', '2010-06-04 17:47:38.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026595, '2010-06-04 17:47:39.000', '2010-06-04 17:48:00.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026596, '2010-06-04 17:48:48.000', '2010-06-04 17:49:07.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026619, '2010-06-04 17:49:19.000', '2010-06-04 17:49:37.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026620, '2010-06-04 17:49:38.000', '2010-06-04 17:49:55.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026621, '2010-06-04 17:49:56.000', '2010-06-04 17:50:14.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026622, '2010-06-04 17:51:39.000', '2010-06-04 17:52:00.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026623, '2010-06-04 17:53:09.000', '2010-06-04 17:53:30.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026624, '2010-06-04 17:52:47.000', '2010-06-04 17:53:08.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026625, '2010-06-04 17:53:56.000', '2010-06-04 17:54:17.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026626, '2010-06-04 17:54:30.000', '2010-06-04 17:54:47.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026627, '2010-06-04 17:54:47.000', '2010-06-04 17:55:05.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026628, '2010-06-04 17:55:06.000', '2010-06-04 17:55:24.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026629, '2010-06-04 17:56:56.000', '2010-06-04 17:57:16.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026630, '2010-06-04 17:58:27.000', '2010-06-04 17:59:15.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026719, '2010-06-04 17:58:05.000', '2010-06-04 17:58:27.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026780, '2010-06-04 17:59:42.000', '2010-06-04 18:00:01.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026819, '2010-06-04 18:00:17.000', '2010-06-04 18:00:35.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026832, '2010-06-04 18:00:35.000', '2010-06-04 18:00:55.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026863, '2010-06-04 18:00:56.000', '2010-06-04 18:01:14.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026885, '2010-06-04 18:01:35.000', '2010-06-04 18:01:56.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026921, '2010-06-04 18:02:25.000', '2010-06-04 18:02:43.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2026923, '2010-06-04 18:02:30.000', '2010-06-04 18:03:51.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027116, '2010-06-04 18:05:22.000', '2010-06-04 18:07:09.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027131, '2010-06-04 18:05:47.000', '2010-06-04 18:10:03.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027132, '2010-06-04 18:05:49.000', '2010-06-04 18:07:55.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027142, '2010-06-04 18:07:50.000', '2010-06-04 18:09:54.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027143, '2010-06-04 18:10:07.000', '2010-06-04 18:11:28.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027144, '2010-06-04 18:10:46.000', '2010-06-04 18:10:58.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027145, '2010-06-04 18:10:53.000', '2010-06-04 18:11:03.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027146, '2010-06-04 18:11:36.000', '2010-06-04 18:13:01.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027147, '2010-06-04 18:14:44.000', '2010-06-04 18:15:47.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027148, '2010-06-04 18:15:56.000', '2010-06-04 18:17:00.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027149, '2010-06-04 18:17:11.000', '2010-06-04 18:17:23.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027150, '2010-06-04 18:17:15.000', '2010-06-04 18:17:27.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027151, '2010-06-04 18:17:19.000', '2010-06-04 18:18:25.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027152, '2010-06-04 18:17:33.000', '2010-06-04 18:17:45.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027153, '2010-06-04 18:17:38.000', '2010-06-04 18:17:49.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027154, '2010-06-04 18:17:41.000', '2010-06-04 18:17:52.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027155, '2010-06-04 18:17:46.000', '2010-06-04 18:17:57.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027156, '2010-06-04 18:18:45.000', '2010-06-04 18:19:49.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027157, '2010-06-04 18:20:05.000', '2010-06-04 18:21:15.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027158, '2010-06-04 18:24:08.000', '2010-06-04 18:25:17.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027159, '2010-06-04 18:36:48.000', '2010-06-04 18:37:45.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027160, '2010-06-04 18:39:47.000', '2010-06-04 18:39:57.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027161, '2010-06-04 19:31:17.000', '2010-06-04 19:31:28.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027162, '2010-06-04 19:31:24.000', '2010-06-04 19:31:35.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027163, '2010-06-04 19:31:26.000', '2010-06-04 19:31:37.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027164, '2010-06-04 19:31:33.000', '2010-06-04 19:31:45.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027165, '2010-06-04 19:31:39.000', '2010-06-04 19:32:51.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027166, '2010-06-04 19:31:53.000', '2010-06-04 19:33:28.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027167, '2010-06-04 19:31:59.000', '2010-06-04 19:33:35.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027168, '2010-06-04 19:33:41.000', '2010-06-04 19:33:50.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027169, '2010-06-04 19:33:46.000', '2010-06-04 19:33:54.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027520, '2010-06-04 19:39:25.000', '2010-06-04 19:39:36.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027528, '2010-06-04 19:39:34.000', '2010-06-04 19:40:36.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027877, '2010-06-04 19:48:10.000', '2010-06-04 19:48:26.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027878, '2010-06-04 19:48:32.000', '2010-06-04 19:48:45.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027879, '2010-06-04 19:48:42.000', '2010-06-04 19:49:44.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027880, '2010-06-04 19:48:56.000', '2010-06-04 19:49:09.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027881, '2010-06-04 19:49:39.000', '2010-06-04 19:49:52.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027882, '2010-06-04 19:49:58.000', '2010-06-04 19:50:07.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027883, '2010-06-04 19:50:09.000', '2010-06-04 19:51:52.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027884, '2010-06-04 19:50:57.000', '2010-06-04 19:51:10.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027885, '2010-06-04 19:51:02.000', '2010-06-04 19:51:11.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027886, '2010-06-04 19:51:07.000', '2010-06-04 19:51:14.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027887, '2010-06-04 19:51:12.000', '2010-06-04 19:51:18.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027888, '2010-06-04 19:52:33.000', '2010-06-04 19:52:44.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027889, '2010-06-04 19:52:40.000', '2010-06-04 19:54:24.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027890, '2010-06-04 19:52:51.000', '2010-06-04 19:52:58.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027891, '2010-06-04 19:54:19.000', '2010-06-04 19:54:32.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027892, '2010-06-04 19:54:26.000', '2010-06-04 19:54:39.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027893, '2010-06-04 19:56:25.000', '2010-06-04 19:56:36.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027894, '2010-06-04 19:56:32.000', '2010-06-04 19:56:38.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027895, '2010-06-04 19:56:35.000', '2010-06-04 19:56:43.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027896, '2010-06-04 20:01:39.000', '2010-06-04 20:02:40.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027897, '2010-06-04 20:01:50.000', '2010-06-04 20:02:03.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027898, '2010-06-04 20:01:57.000', '2010-06-04 20:02:10.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027899, '2010-06-04 20:02:06.000', '2010-06-04 20:02:19.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027900, '2010-06-04 20:02:18.000', '2010-06-04 20:03:22.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027901, '2010-06-04 20:02:30.000', '2010-06-04 20:03:34.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027902, '2010-06-04 20:03:24.000', '2010-06-04 20:03:37.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027903, '2010-06-04 20:03:32.000', '2010-06-04 20:03:45.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027904, '2010-06-04 20:03:45.000', '2010-06-04 20:05:52.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027905, '2010-06-04 20:03:50.000', '2010-06-04 20:05:59.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027906, '2010-06-04 20:03:52.000', '2010-06-04 20:06:01.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027907, '2010-06-04 20:04:49.000', '2010-06-04 20:04:55.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027908, '2010-06-04 20:04:56.000', '2010-06-04 20:05:03.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027909, '2010-06-04 20:05:05.000', '2010-06-04 20:05:12.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027910, '2010-06-04 20:05:12.000', '2010-06-04 20:05:21.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027911, '2010-06-04 20:05:22.000', '2010-06-04 20:05:33.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027912, '2010-06-04 20:10:34.000', '2010-06-04 20:10:45.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027913, '2010-06-04 20:10:44.000', '2010-06-04 20:10:55.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2027952, '2010-06-04 20:18:15.000', '2010-06-04 20:19:16.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028114, '2010-06-04 20:20:40.000', '2010-06-04 20:20:51.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028159, '2010-06-04 20:21:04.000', '2010-06-04 20:21:17.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028160, '2010-06-04 20:21:04.000', '2010-06-04 20:21:17.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028386, '2010-06-04 20:32:24.000', '2010-06-04 20:32:35.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028387, '2010-06-04 20:41:36.000', '2010-06-04 20:42:25.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028388, '2010-06-04 20:41:44.000', '2010-06-04 20:42:24.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028389, '2010-06-04 20:41:50.000', '2010-06-04 20:42:28.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028390, '2010-06-04 20:47:53.000', '2010-06-04 20:48:00.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028391, '2010-06-04 20:50:20.000', '2010-06-04 20:50:40.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028392, '2010-06-04 20:50:56.000', '2010-06-04 20:51:13.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028393, '2010-06-04 20:51:26.000', '2010-06-04 20:51:33.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028394, '2010-06-04 20:56:38.000', '2010-06-04 20:56:45.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028395, '2010-06-04 20:56:59.000', '2010-06-04 20:57:12.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028396, '2010-06-04 20:58:35.000', '2010-06-04 20:58:42.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028397, '2010-06-04 20:59:04.000', '2010-06-04 20:59:17.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028398, '2010-06-04 20:59:24.000', '2010-06-04 20:59:31.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028399, '2010-06-04 21:01:39.000', '2010-06-04 21:01:52.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028400, '2010-06-04 21:01:56.000', '2010-06-04 21:02:09.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028401, '2010-06-04 21:02:10.000', '2010-06-04 21:02:23.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028402, '2010-06-04 21:02:30.000', '2010-06-04 21:02:45.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028403, '2010-06-04 21:02:38.000', '2010-06-04 21:02:52.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028404, '2010-06-04 21:02:52.000', '2010-06-04 21:03:08.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028405, '2010-06-04 21:03:09.000', '2010-06-04 21:03:25.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028406, '2010-06-04 21:03:19.000', '2010-06-04 21:03:35.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028407, '2010-06-04 21:04:03.000', '2010-06-04 21:04:16.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028408, '2010-06-04 21:05:00.000', '2010-06-04 21:05:07.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028409, '2010-06-04 21:05:10.000', '2010-06-04 21:05:17.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028410, '2010-06-04 21:05:12.000', '2010-06-04 21:05:19.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028411, '2010-06-04 21:05:21.000', '2010-06-04 21:05:27.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028412, '2010-06-04 21:15:41.000', '2010-06-04 21:15:54.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028413, '2010-06-04 21:15:58.000', '2010-06-04 21:16:11.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028414, '2010-06-04 21:16:06.000', '2010-06-04 21:16:19.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028415, '2010-06-04 21:16:13.000', '2010-06-04 21:16:31.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028416, '2010-06-04 21:16:15.000', '2010-06-04 21:16:33.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028417, '2010-06-04 21:16:26.000', '2010-06-04 21:16:41.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028418, '2010-06-04 21:16:34.000', '2010-06-04 21:16:50.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028419, '2010-06-04 21:29:17.000', '2010-06-04 21:29:24.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028420, '2010-06-04 21:29:53.000', '2010-06-04 21:30:00.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028421, '2010-06-04 21:30:49.000', '2010-06-04 21:30:56.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028422, '2010-06-04 21:31:49.000', '2010-06-04 21:31:56.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028423, '2010-06-04 21:34:22.000', '2010-06-04 21:34:29.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028424, '2010-06-04 21:35:02.000', '2010-06-04 21:35:08.000')

    INSERT INTO [dbo].[SubJobs] ([subjobid], [Started], [finished]) VALUES (2028425, '2010-06-04 21:35:58.000', '2010-06-04 21:36:05.000')

    SET IDENTITY_INSERT [dbo].[SubJobs] OFF

  • DECLARE

    @SDateTime DATETIME,

    @EDateTime DATETIME ;

    SELECT

    @SDateTime = '11/4/10',

    @EDateTime = GETDATE() ;

    ;

    WITH Numbers(Number)

    AS (SELECT TOP 86400

    ROW_NUMBER() OVER (ORDER BY S1.OBJECT_ID) - 1

    FROM

    sys.columns AS S1

    CROSS JOIN sys.columns AS S2) ,

    Times(TSec)

    AS (SELECT

    DATEADD(SECOND, Number, @SDateTime)

    FROM

    Numbers

    WHERE

    Number BETWEEN 0

    AND DATEDIFF(SECOND, @SDateTime, @EDateTime))

    SELECT

    TSec AS [Time],

    (SELECT

    count(*)

    FROM

    dbo.cps_subjobs

    where

    [Started] <= TSec

    AND [finished] >= TSec

    and subJobTypeId IN (19, 21)) AS Jobs

    FROM

    Times

    ORDER BY

    TSec ;

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • it really takes long time to execute 🙁

  • What indexes do you have defined on that table?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • PK is the SubJobId (for other queries)

    and the index that I added for this kind of query is

    Started, Finished, SubJobID

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic. Login to reply