Programmatically find out when SQL Server service is started

1.      First Option is to  check when the tempdb database is created. This is the exact time at which the services were restarted.

 

1. SELECT crdate AS 'SQL Server service started Time'

FROM master.dbo.sysdatabases

WHERE name = 'tempdb'

    11.png


2.    
Second Option is the information about the database startup will be available while executing the command,

exec xp_readerrorlog


    12.png






Ebook Download
View all
Learn
View all