Showing posts with label backup. Show all posts
Showing posts with label backup. Show all posts

Wednesday, March 21, 2012

Date of Database Last Back

Hi,
Anyone know how to determine the
datetime of the last backup for a
database, in code?
Thanks,
RogerCheck out the system table msdb..backupset. It should contain the
information you are looking for.
Anith|||Yes, thank you.
I was looking to use the DBID, but this column
is not in backupset.
So, must use DBName and db.creation date;
but the create datetime is just a little different
in sysdatabases compared to backupset, but since
it is only < 1 second, truncating to the minute
will work.
Thanks,
Roger

> Check out the system table msdb..backupset. It should contain the
> information you are looking for.
> --
> Anith
>sql