doubt on backups

  • 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')

    ---------------------------------------------------------------------

  • it will give the complete information of those are backed up or single database information

  • all databases on the sql instance

    ---------------------------------------------------------------------

  • Here after execution the above query it is showing some error

    Msg 208, Level 16, State 1, Line 1

    Invalid object name 'master.sysdatabases'.

  • 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