06-23-2014 10:23 AM
IHAC who wants to build a query to return all failed SQL jobs and include the database name. I have gotten that far.
The catch is...he wants it to also filter by retry attempt. He has jobs that fail on attempt one but finish on attempt 2.
He wants to filter those out. I know SQL well enough to write that query if I can find the database field to query by.
Any help is appreciated
Solved! Go to Solution.
06-25-2014 11:22 AM
Maybe something like this?
SELECT
id AS "Job ID",
clientname as "Name",
policyName AS "Policy Name",
(bytesWritten / 1024 / 1024) AS "MB Written",
attemptCount AS "Backup Attempts"
FROM domain_job
WHERE statusCode <> 0 AND attemptCount > 1 AND policyType=15
06-25-2014 11:22 AM
Maybe something like this?
SELECT
id AS "Job ID",
clientname as "Name",
policyName AS "Policy Name",
(bytesWritten / 1024 / 1024) AS "MB Written",
attemptCount AS "Backup Attempts"
FROM domain_job
WHERE statusCode <> 0 AND attemptCount > 1 AND policyType=15