Michael O'Dea-Jones' Blog

How to work out how long a SQL Instance has been running

Recently I had to come up with a way of determining how long a SQL Instance had been running. It turns out that there are a few ways to do it and here is my preferred way:

SELECT crdate

FROM sysdatabases
WHERE [name] = 'tempdb'

This works because the tempdb database is recreated every time the SQL Service is started. As an alternative you could get the date from the first entry in the current SQL Log:

SQL Log

Published Monday, November 24, 2008 11:42 AM by michael@wardyit.com

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit