Backup & Restoration Script

  • Comments posted to this topic are about the item Backup & Restoration Script

  • Your elapsed minutes calculation is wrong (plug in an elapsed time exceeding 1 hour to see). Change old to new as shown below

    --old

    --cast(datediff(ss,BS.backup_start_date,BS.backup_finish_date)/60 as varchar(10))

    --new

    cast((datediff(ss,BS.backup_start_date,BS.backup_finish_date)/60) - (datediff(ss,BS.backup_start_date,BS.backup_finish_date)/3600) * 60 as varchar(10))


    Cursors are useful if you don't know SQL

  • The following formats the duration in HH:MI:SS.

    CONVERT( VARCHAR(8), DATEADD( SECOND, DATEDIFF( second, s.backup_start_date, s.backup_finish_date ), 0 ), 114 )

  • Thanks for the script.

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

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