I\'d like if its possible to work out from inside sql server how long sql server has been running.
Would like to use this in conjunction with one of the DMV\'s for unuse
SELECT crdate FROM sysdatabases WHERE [name] = 'tempdb'
The above will work on SQL Server 2000, 2005 and 2008.
The logic is that the result from the above SQL returns the created date of the tempdb database, which SQL Server recreates every time it is restarted. Hence, the created date of tempdb is the startup time of the server.