Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 SQL DB Backup History...
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

petek
Posting Yak Master

United Kingdom
192 Posts

Posted - 02/13/2013 :  07:40:36  Show Profile  Reply with Quote
Hi i have the query below and need some help on getting some data from sysjobhistory to show only jobs that were successful...

SELECT
BS.database_name
, CAST(BF.file_size/1024/1024 AS bigint) AS file_size_mb
, CAST(BF.backup_size/1024/1024 AS bigint) AS consumed_size_mb
, BF.logical_name
, BF.physical_name
, BS.backup_finish_date AS polling_date
FROM msdb.dbo.backupset BS
INNER JOIN msdb.dbo.backupfile BF ON BS.backup_set_id = BF.backup_set_id
WHERE BS.type = 'D'
AND BS.backup_finish_date >= '2013-01-31'
AND BS.database_name not in ('msdb', 'master', 'model')
AND BF.file_size/1024 > 1
AND BF.backup_size/1024 > 1
ORDER BY BS.database_name
, BF.logical_name
, BS.backup_finish_date DESC;

thanks in advance for looking

Kind Regards

Pete.
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000