Three methods of querying SQL server startup time

Time:2021-4-9

In the morning, I’m analyzing the usage of the index. I want to see when the database was started to ensure that there is no problem with the statistical data. I can use the following three methods to query:

--2008 and later
SELECT sqlserver_start_time
FROM sys.dm_os_sys_info
 
select crdate from master..sysdatabaseswherename='tempdb'
 
SELECT login_time FROMsysprocesses WHEREspid= 1