Showing posts with label queried. Show all posts
Showing posts with label queried. Show all posts

Monday, March 19, 2012

How can you tell the date of the last full database backup?

How can you tell the date of the last full database backup?
Is there a system table that can be queried?
Robert Alexander
Robert.Alexander@.cca-audit.comSELECT TOP 3 *
FROM msdb..backupset
WHERE database_name=DB_NAME()
ORDER BY backup_finish_date DESC
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Robert Alexander" <robert.alexander@.cca-audit.com> wrote in message
news:ev6oXZNyEHA.3376@.TK2MSFTNGP12.phx.gbl...
> How can you tell the date of the last full database backup?
> Is there a system table that can be queried?
> Robert Alexander
> Robert.Alexander@.cca-audit.com
>
>|||Close. You have to use the type column if there are log and/or differential
backups from that database. 'D' for Database, 'I' for Differential, 'L' for
Log. So that gives:
SELECT TOP 3 *
FROM msdb..backupset
WHERE database_name=DB_NAME()
AND [TYPE] = 'D'
ORDER BY backup_finish_date DESC
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:e36MweNyEHA.804@.TK2MSFTNGP12.phx.gbl...
> SELECT TOP 3 *
> FROM msdb..backupset
> WHERE database_name=DB_NAME()
> ORDER BY backup_finish_date DESC
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Robert Alexander" <robert.alexander@.cca-audit.com> wrote in message
> news:ev6oXZNyEHA.3376@.TK2MSFTNGP12.phx.gbl...
> > How can you tell the date of the last full database backup?
> >
> > Is there a system table that can be queried?
> >
> > Robert Alexander
> > Robert.Alexander@.cca-audit.com
> >
> >
> >
> >
>