Script

  • Hi

    can any one send me the query to find the starttime , end time and duration in secs of the completion of the backup of all the databases in sql2000 and in sql2005 .

  • Here is the one for SQL Server 2005.

    SELECT d.name, MAX(b.backup_finish_date) AS last_backup_finish_date

    FROM master.sys.databases d

    LEFT OUTER JOIN msdb.dbo.backupset b ON d.name = b.database_name AND b.type = 'D'

    WHERE d.database_id NOT IN (2, 3)

    GROUP BY d.name

    ORDER BY 2 DESC

    For SQL Server 2000 replace master.sys.databases with master.sysdatabases

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • Cool, pretty easy stuff...

  • @ pradeep adiga

    Wow

    gr8 script

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply