Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
TSQL 15
BRH 13
SQL Server 13
#SQL Server 12
#TSQL 8
#SQLServer 4
SQL Server Agent 3
Stored Procedure 2
SQL server Jobs 2
Change Data Capture CDC 2

Archive · View All
November 2010 4
October 2010 3
April 2011 3
March 2011 3
January 2012 2
November 2011 2
August 2011 2
September 2010 1
October 2011 1

T-SQL to get the SQL Server Service Start time and Up time of SQL Server service

Nov 17 2011 6:46AM by Manjunath C Bhat   

There are number of occasions where we need to get to know the SQL Server service start date time and also from what time the SQL Services are up and running generally termed as Uptime. There are many ways to do it like check for temp DB Creation time, using DMF sys.dm_io_virtual_file_stats etc. Below written is small T-SQL script but very useful which provides you this information. Hope this is useful. Comments and suggestions are always welcome.

USE MASTER
GO
SET NOCOUNT ON
GO
SELECT 'SQL server started at ' + 
CAST((CONVERT(DATETIME, sqlserver_start_time, 126)) AS VARCHAR(20))
+' and is up and running from '+
CAST((DATEDIFF(MINUTE,sqlserver_start_time,GETDATE()))/60 AS VARCHAR(5)) 
+ ' hours and ' +
RIGHT('0' + CAST(((DATEDIFF(MINUTE,sqlserver_start_time,GETDATE()))%60) AS VARCHAR(2)),2) 
+ ' minutes' AS [Start_Time_Up_Time] FROM sys.dm_os_sys_info
GO
SET NOCOUNT OFF
GO 

Tags: #SQL Server, TSQL, #TSQL, BRH, #SQLServer, SQL Server Start time, SQL Server Uptime, Uptime, Starttime,


Manjunath C Bhat
102 · 2% · 511
3
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

"T-SQL to get the SQL Server Service Start time and Up time of SQL Server service" rated 5 out of 5 by 3 readers
T-SQL to get the SQL Server Service Start time and Up time of SQL Server service , 5.0 out of 5 based on 3 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]