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

Recommended Today

Analysis of super comprehensive MySQL statement locking (Part 1)

A series of articles: Analysis of super comprehensive MySQL statement locking (Part 1) Analysis of super comprehensive MySQL statement locking (Part 2) Analysis of super comprehensive MySQL statement locking (Part 2) Preparation in advance Build a system to store heroes of the Three KingdomsheroTable: CREATE TABLE hero ( number INT, name VARCHAR(100), country varchar(100), PRIMARY […]