March 23, 2013 at 5:58 am
use the backup details in msdb - this query will tell you when a database was last backed up (full backup)
select a.name, b.backup_finish_date, a.crdate
from master..sysdatabases a left join msdb..backupset b on a.name = b.database_name
where b.backup_finish_date IS NULL or b.backup_finish_date = (select max(backup_finish_date)
from msdb..backupset where database_name = a.name and type = 'D')
---------------------------------------------------------------------
March 23, 2013 at 6:06 am
it will give the complete information of those are backed up or single database information
March 23, 2013 at 6:16 am
all databases on the sql instance
---------------------------------------------------------------------
March 25, 2013 at 12:08 am
Here after execution the above query it is showing some error
Msg 208, Level 16, State 1, Line 1
Invalid object name 'master.sysdatabases'.
March 25, 2013 at 3:28 am
must be an error in copy and paste - you are missing a '.' - it should read master..sysdatabases
this code is compatible with all versions of sql from sql2000, you could also use master.sys.databases
---------------------------------------------------------------------
Viewing 5 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply