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

后端 未结 6 1397
春和景丽
春和景丽 2021-02-07 22:11

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

6条回答
  •  一整个雨季
    2021-02-07 23:02

    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
    

提交回复
热议问题