Quantcast
Channel: inSQLServer.com - Script Store
Viewing all articles
Browse latest Browse all 5

Script to check when was SQL Server restarted

$
0
0

There several ways you can check when was SQL server restarted last time. Below are some sql queries to quickly find out the server restart date time. You can run any one of below, all will give same result.

1) sp_readerrorlog 0,1,'Copyright (c)'

 

2) SELECT sqlserver_start_time FROM sys.dm_os_sys_info;

 

3) SELECT login_time FROM sys.dm_exec_sessions WHERE session_id = 1;

 

4) select start_time from sys.traces where is_default = 1

 

5) SELECT crdate FROM sysdatabases WHERE name='tempdb'

 

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


Tags: 


Viewing all articles
Browse latest Browse all 5

Trending Articles