Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 16th, 2005, 09:36 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default SP to report all databases with Last backup

Is there a built in Stored proc that will enum all of the databases on a server and display the last backup time?



Hal Levy
I am here to help you, not do it for you.
That is, unless you hire me. I am looking for work.
__________________
Hal Levy
 
Old May 16th, 2005, 11:41 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hal, sp_databases will lists databases that reside in an instance of Microsoft® SQL Server™ or are accessible through a database gateway.

Regarding last backup time I think there is no system stored procedure but might want to query backupset table on your msdb database.

SELECT [database_name],[backup_finish_date]
FROM [msdb].[dbo].[backupset]

 
Old May 17th, 2005, 09:37 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Shahchi, This select statement works with what I wanted-- however i must admit I am having some kid of brain drain at the moment-- perhaps too much time not working.. IN any case...

I need to get only the latest... for each database... so I will work on it further.. thanks for the pointer

Hal Levy
I am here to help you, not do it for you.
That is, unless you hire me. I am looking for work.
 
Old May 17th, 2005, 10:10 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hal, can't you just do a select max, group by ...?

If you need anything more complicated then a correlated subquery is what you need.

rgds
Phil
 
Old May 17th, 2005, 10:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Phil,

I am trying to get a final requirement on what they want... I think I can use the max.. and they were happy with that-- but they are now saying they might want the last "few"...

Hal Levy
I am here to help you, not do it for you.
That is, unless you hire me. I am looking for work.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Report Services Wont execute My SP desireemm Reporting Services 1 December 21st, 2007 03:46 AM
Using Two Databases in One Report Thamzyne Crystal Reports 1 March 5th, 2007 05:56 PM
Using SP in Crystal Report with c# psutradhar C# 0 January 12th, 2007 06:27 AM
Report based on two databases jasonkiwi BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 July 15th, 2004 07:44 PM
Backup Text Report acko SQL Server 2000 1 April 13th, 2004 12:24 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.