Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Backup & Restoration Script Expand / Collapse
Author
Message
Posted Thursday, September 10, 2009 3:34 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, May 7, 2014 5:48 AM
Points: 50, Visits: 47
Comments posted to this topic are about the item Backup & Restoration Script
Post #786053
Posted Wednesday, September 16, 2009 10:25 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Wednesday, September 17, 2014 10:34 AM
Points: 436, Visits: 2,285
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
Post #789118
Posted Thursday, July 1, 2010 12:17 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, August 22, 2013 9:43 AM
Points: 136, Visits: 133
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 )
Post #946390
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse