• This query gives you the date of the last FULL backup of each database or gives you the commandline to perform a FULL backup. Adjust this commandline in the query to fit your needs. You could loop through this output to execute the generated comand lines.

    select

    db.name

    , bs.type

    , bs.backup_finish_date

    , case when bs.type is null

    then 'BACKUP DATABASE [' + db.name + '] TO DISK = N''C:\SQL\Backup\' + db.name + '.bak'' WITH NOFORMAT, NOINIT, NAME = N''' + db.name + '-Full Database Backup'', SKIP, NOREWIND, NOUNLOAD, STATS = 10'

    else null

    end as Backup_command

    from

    ( -- use a sub-select to determine the date of the last FULL backup for each database

    select database_name

    , type

    , MAX(backup_finish_date) as backup_finish_date

    from msdb..backupset

    where type = 'D'

    group by

    database_name

    , type) bs

    right outer join master.sys.databases db

    on bs.database_name = db.name

    where db.name <> 'tempdb' -- it's not possible to backup the TEMPDB

    order by bs.backup_finish_date desc

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **