• Just off the top of my head, I'd do something like below ... if no backup date appears, then there was no full backup after the last restore.

    SELECT tdb.*, rh.restore_date AS Last_Restore, bs2.backup_finish_date AS Backup_After_Restore

    FROM dbo.tUserDBs tdb

    OUTER APPLY (

    SELECT TOP (1) *

    FROM msdb.dbo.restorehistory rh2

    WHERE

    rh2.destination_database_name = tdb.DBName AND

    (rh2.restore_type IS NULL OR rh2.restore_type <> 'V')

    ORDER BY restore_history_id DESC /*presumably accurate rather than datetime*/

    ) AS rh

    OUTER APPLY (

    SELECT TOP (1) *

    FROM msdb.dbo.backupset bs2

    WHERE

    bs2.database_name = tdb.DBName AND

    bs2.is_copy_only = 0 AND

    bs2.is_snapshot = 0 AND

    bs2.type = 'D' AND

    bs2.backup_finish_date > rh.restore_date

    ORDER BY backup_set_id DESC /*presumably accurate vs datetime*/

    ) AS bs2

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.