1
Reply

How to programmatically find out when the SQL Server service started?

Venkat Raju 0

Venkat Raju 0

17y
7.5k
0
Reply

    Everytime SQL Server starts, it recreates the tempdb database. So, the creation date and time of the tempdb database tells us the date and time at which SQL Server service started. This information is stored in the crdate column of the sysdatabases table in master database. Here's the query to find that out:

    SELECT crdate AS 'SQL Server service started approximately at:'
    FROM master.dbo.sysdatabases
    WHERE name = 'tempdb'