开发者

Database backup in SQL Server 2008

开发者 https://www.devze.com 2023-01-08 09:12 出处:网络
How can i check with SQL query 开发者_开发技巧whether Database backup JOB is created or not ? Thank YouThis query will return all jobs that have the command BACKUP DATABASE in them:

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'
0

精彩评论

暂无评论...
验证码 换一张
取 消