Tuesday, January 5, 2010

What's the uptime of my MSSQL?

Uptime with MSSQL 2005 and MSSQL 2008

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


Uptime with MSSQL 2000


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

No comments:

Post a Comment