Please start any new threads on our new site at 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!
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Ho do I know if a DB has ever been backed up?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

81 Posts

Posted - 12/10/2012 :  15:18:40  Show Profile  Reply with Quote
Hi, I have a SQL server 2000 DB on my network and I need to know if the database has ever been backed up, and/or if these backups occur on a regular basis.

The DB is using the full recovery model, so I guess if there are backups being performed these would be full, differential and transaction log (although I suppose you can still choose which of these you want to occur with the full recovery model, maybe?).

Anyway, I need to know, I'd like to know how to do this through both the GUI and SQL queries, but either way will do to get the job done, from googling, it seems pretty hard to find a concrete answer.

Hope you don't mind this question, thanks for any help :)

Edited by - mitin on 12/10/2012 15:19:52

Almighty SQL Goddess

38200 Posts

Posted - 12/10/2012 :  16:35:26  Show Profile  Visit tkizer's Homepage  Reply with Quote
Take a look at the backup* system tables in the msdb database.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server

Subscribe to my blog
Go to Top of Page

Flowing Fount of Yak Knowledge

United Kingdom
2179 Posts

Posted - 12/11/2012 :  01:56:40  Show Profile  Visit jackv's Homepage  Reply with Quote
The relevant tables are : backupset, and backupmediafamily . They join on the "media_set_id" column

Jack Vamvas
Go to Top of Page

Yak Posting Veteran

81 Posts

Posted - 12/11/2012 :  05:16:36  Show Profile  Reply with Quote
Thanks guys, I can see in the backupset family that one backup has been taken before, that is all, looks like this wasn't scheduled and just a manual backup when required that one time.

If scheduled backups occurred, say every week for example, then there would be an entry for each of these in this table right?

thanks for the info!
Go to Top of Page

Flowing Fount of Yak Knowledge

United Kingdom
2179 Posts

Posted - 12/11/2012 :  07:11:12  Show Profile  Visit jackv's Homepage  Reply with Quote
Yes , there would be entries. Unless someone clears down the tables
Use this query for view the backup history -
Jack Vamvas

Edited by - jackv on 12/12/2012 01:50:25
Go to Top of Page

Yak Posting Veteran

94 Posts

Posted - 12/11/2012 :  11:04:02  Show Profile  Reply with Quote
I usually go to the database and run this

CAST(CAST(s.backup_size / 1000000 AS INT) AS VARCHAR(14)) + ' ' + 'MB' AS bkSize,
CAST(DATEDIFF(second, s.backup_start_date,
s.backup_finish_date) AS VARCHAR(4)) + ' ' + 'Seconds' TimeTaken,
CAST(s.first_lsn AS VARCHAR(50)) AS first_lsn,
CAST(s.last_lsn AS VARCHAR(50)) AS last_lsn,
CASE s.[type]
WHEN 'D' THEN 'Full'
WHEN 'I' THEN 'Differential'
WHEN 'L' THEN 'Transaction Log'
END AS BackupType,
FROM msdb.dbo.backupset s
INNER JOIN msdb.dbo.backupmediafamily m ON s.media_set_id = m.media_set_id
WHERE s.database_name = DB_NAME() -- Remove this line for all the database
ORDER BY backup_start_date DESC, backup_finish_date

Go to Top of Page
  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.15 seconds. Powered By: Snitz Forums 2000