Finding the last time when server was restarted
Here is some methods to find the last time the sql server /service was restarted.
Method 1
The first method uses the feature that, ‘tempdb’ will be recreated with every restart. So we need to check the created date (crdate) from master..sysdatabases.
SELECT crdate FROM master..sysdatabases WHERE name ='tempdb'
Method 2
In the second method, we check the master..sysprocesses database and check for the minimum value in the ‘login_time’ column.
SELECT MIN(login_time) FROM master..sysprocesses
Method 3
Refer ‘Event Viewer’ and check when the sql server service was started.
Label List
- Architecture
- Art of SQL Server
- asynchronous mirroring
- csv
- dmv
- find outdated Statistics
- Free SQL Server tools
- index fragmentation
- Installation
- Katmai
- Learn SQL Server 2005
- Maintenance Plan
- outdated Statistics
- Reset Identity column
- Scripts
- SPID
- sql server 2008
- sys.dm_db_index_physical_stats
- sys.dm_exec_connections
- tsql
- update statistics