简体   繁体   中英

Database backup in SQL Server 2008

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

Thank You

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'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM