|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 3:03 AM
Points: 73,
Visits: 386
|
|
Thanks James, You did a great job! It's working perfect!
Best regards Helmut
Database Architect initPRO GmbH [url=http://www.initpro.de][/url]
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 3:03 AM
Points: 73,
Visits: 386
|
|
Great job! It's very useful!
Helmut
Database Architect initPRO GmbH [url=http://www.initpro.de][/url]
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Wednesday, March 06, 2013 12:56 AM
Points: 898,
Visits: 1,045
|
|
Here's a handy function which shows the current status of the exec_queue:
if exists (select 1 from sys.objects where name = 'udf_queue_status') drop function dbo.udf_queue_status go
create function dbo.udf_queue_status() returns table as return ( with cte(total, waiting, running, finished, succeeded, failed) as ( select (select count(*) from pmaster..exec_queue) as total , (select count(*) from pmaster..exec_queue where worker_start_time is null and worker_end_time is null) as "waiting" , (select count(*) from pmaster..exec_queue where worker_start_time is not null and worker_end_time is null) as "running" , (select count(*) from pmaster..exec_queue where worker_start_time is not null and worker_end_time is not null) as "finished" , (select count(*) from pmaster..exec_queue where return_code = 0) as "succeeded" , (select count(*) from pmaster..exec_queue where return_code > 0) as "failed" ) select total, waiting, running, finished, (cast(finished as real) / cast(coalesce(nullif(total,0),1) as real)) * 100 as percent_complete, succeeded, failed from cte ) go
EXECUTE sp_ms_marksystemobject 'udf_queue_status' go
Wilfred The best things in life are the simple things
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, April 16, 2013 11:08 AM
Points: 1,
Visits: 38
|
|
Greetings James,
Very late to the party here, but wanted to add our thanks: excellent work, that is deeply appreciated.
Also to Wilfrid: thanks for your status function, nicely done and most useful.
All the best --Squong
|
|
|
|