Quantcast
Channel: Latest Questions by roblxndr
Viewing all articles
Browse latest Browse all 26

SQL Sentry Job History Query blocks Agent jobs

$
0
0
The following SQL Sentry query is creating a long lasting blocking condition that is interfering with other Agent jobs. How do I stop this query from executing until I can figure out why it is performing so badly? (@instance_id int)SELECT * FROM (SELECT DISTINCT TOP 5000 sysjobhistory.* FROM sysjobhistory WITH (NOLOCK) LEFT OUTER JOIN ( SELECT DISTINCT sysjobs.job_id FROM sysjobs INNER JOIN sysjobsteps ON sysjobsteps.job_id = sysjobs.job_id WHERE (sysjobs.name NOT LIKE 'SQL Sentry% Queue Monitor' AND sysjobs.name NOT LIKE 'SQL Sentry% Alert Trap' AND sysjobsteps.command NOT LIKE '%.AddEvent @EventType%') ) NonSystemJobs ON sysjobhistory.job_id = NonSystemJobs.job_id WHERE (NonSystemJobs.job_id IS NOT NULL OR run_status = 0) AND instance_id > @instance_id ORDER BY instance_id DESC) RemoteHistory ORDER BY instance_id ASC

Viewing all articles
Browse latest Browse all 26

Trending Articles