Method 2: Using tempdb database creation date
SELECT sqlserver_start_time FROM sys.dm_os_sys_info
Method 3: Using sp_readerrorlog
SELECT create_date FROM sys.databases WHERE name = 'tempdb'
What are the different ways to get last restart of Windows Server? Method 1: Using Task Manager Up time represents how long the server is being up and running since the last restart. So to calculate when did the reboot happened, need to substract the up time with current date and time. Method 2: Using systeminfo command
sp_readerrorlog 0,1,'Copyright (c)'
Hope this helps and if you have any other ways, please share in the comment section. I’d like to grow my readership. If you enjoyed this blog post, please share it with your friends!
systeminfo | find /i "Boot Time"