Login or Sign Up to become a member!

EXPERTS, INFORMATION, IDEAS & KNOWLEDGE

Social bookmarker Add this

Your profile

Search

January 2009
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

XML Feeds

Authors

« How to get the selectivity of an indexDo automated restore tests on your SQL-Backups. »
The Data Management Journal

Find the last Backup taken in SQL Server

by chrissie1


Permalink 17 May 2008 01:55 , Categories: Microsoft SQL Server
  1. SELECT *
  2. FROM msdb.dbo.backupmediafamily backupmediafamily
  3. JOIN msdb.dbo.backupset backupset ON backupmediafamily.media_set_id = backupset.media_set_id
  4. and backupset.backup_start_date = (SELECT max(backup_start_date)
  5. FROM msdb.dbo.backupset child
  6. WHERE child.database_name = backupset.database_name and child.type = ‘D’)
  7. and database_name = ‘ReplaceWithDatabaseNameHere’
  8. and backupset.type = ‘D’

This is based on something I found here. Thank you mrdenny.

And this works in SQL Server 2000.

Leave a comment »Send a trackback » 91 views

Trackback address for this post

Trackback URL (right click and copy shortcut/link location)

No feedback yet

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
PoorExcellent
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)