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 unused indexes, but the counters are re-set every time sql server loads, so I'd like to know how useful they're going to be.
This is the exact time: SELECT sqlserver_start_time FROM sys. dm_os_sys_info. The value tends to be slightly earlier than the sys. dm_exec_sessions method.
In the SQL Server Configuration Manager, from the left pane select SQL Server Services. Now, some services will appear in the right pane. Now, each service in the right pane will have some icon. If the service have green triangle icon then, it means the service is running.
I know this is super old, but Microsoft has added a new DMV with this information since this question was asked.
SELECT dosi.sqlserver_start_time
FROM sys.dm_os_sys_info AS dosi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With