Thursday 8 November 2012

Query to Check the SQL Server Restart time

You can either query below DMV or check the tempDB creation date.

SELECT Dateadd(s, ( ( -1 ) * ( osd.[ms_ticks] / 1000 ) ), Getdate()) AS serverrestartdatetime,
osd.sqlserver_start_time
FROM sys.[dm_os_sys_info] osd;

OR

SELECT name,
crdate
FROM sys.sysdatabases
WHERE name = ‘tempdb’

No comments:

Post a Comment