LLI Wiki — My Digital Knowledge Base

Get the SQL Server instance start time

Three T-SQL queries to get the last start time of a SQL Server instance, directly or through indirect indications.

These three queries return the time the SQL Server instance started, that is the date of the last restart of the service, from different dynamic management views.

SELECT sqlserver_start_time FROM sys.dm_os_sys_info;

SELECT login_time FROM sys.dm_exec_sessions WHERE session_id = 1;

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

Explanation

Notes

Mastodon LLIMastodon SocialFosstodon