Online Tutorials & Training Materials |
Register Login

Do You have Any Script to Find Out Who Stopped and Restarted SQL Server?

Rohit Mahajan || 02 Nov 2015 3:33 pm || 1

Hello Experts,

Do you have any script to find out who stopped and restarted sql server ?

Please let me know if you have.

Thanks in advance.


  • 02 Nov 2015 3:35 pm Helpful Answer

    Hello follow.

    This commands and if we want more information , you have to event viewer .SELECT sqlserver_start_time FROM sys.dm_os_sys_info; 
    SELECT login_time FROM sys.dm_exec_sessions WHERE session_id = 1; 
    select start_time from sys.traces where is_default = 1 
    SELECT crdate FROM sysdatabases WHERE name='tempdb' 
    SELECT create_date FROM sys.databases WHERE name = 'tempdb'