Sql Server - how to get last server restart (DMV reset date/time) Sql Server - how to get last server restart (DMV reset date/time) sql-server sql-server

Sql Server - how to get last server restart (DMV reset date/time)


SELECT sqlserver_start_time FROM sys.dm_os_sys_info


Using a prior question (different key words), I ended up using this approach. As always, up to the individual what would be 'best' for them!

SELECT create_date FROM sys.databases WHERE name = 'tempdb'

source: Find out how long the sql server service has been running, from t-sql


This will work but you have to know the service name also its only available with R2 and later

SELECT last_startup_time FROM   sys.dm_server_services WHERE  servicename = "Your Service name" 

Although this won't be totally accurate since you can also reset the DB specific views via a DB detach or a DB close.

Also there are two views that can be reset on a live db sys.dm_os_latch_stats and sys.dm_os_wait_stats