0

How can i check with SQL query whether Database backup JOB is created or not ?

Thank You

0

1 Answer 1

1

This query will return all jobs that have the command BACKUP DATABASE in them:

SELECT  SV.name,
        SV.description,
        S.step_id
FROM    msdb.dbo.sysjobs_view SV
INNER JOIN msdb.dbo.sysjobsteps S ON SV.job_id = S.job_id
WHERE   s.command LIKE '%BACKUP DATABASE%'

If you setup the job categories properly to have a category called 'Database Backup' the following would also work:

SELECT  SV.name,
        SV.description
FROM    msdb.dbo.sysjobs_view SV
INNER JOIN msdb.dbo.syscategories SC ON SV.category_id = SC.category_id
WHERE SC.Name = 'Database Backup'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.