Skip to content

How to Find the Up-Time of a SQL Server Instance

sql server emergency

Your DMV stats are only as good as the amount of data they’ve managed to collect since the last SQL Server restart.

To find out how long your SQL Server has been running, you can check the time stamp of the spid 1 using the following TSQL;

SELECT login_time AS 'Started', DATEDIFF(DAY, login_time, CURRENT_TIMESTAMP) AS 'Uptime in days'
FROM sys.sysprocesses
WHERE spid = 1;