SQL Server restart time

Posted: September 21, 2011 by Virendra Yaduvanshi in SQL General

——1)From TempDB created date using sys.databases

            SELECT create_date from sys.Databases where database_id=2

——2)From TempDB created date using sys.sysdatabases    

            SELECT crdate from sys.sysDatabases where DBID =2

——3)From sysprocesses    

SELECT login_time FROM master..sysprocesses WHERE cmd = ‘LAZY WRITER’

——4)From sysprocesses

SELECT min(login_time) from master..sysprocesses

——5)From sysprocesses

SELECT min(login_time) from sys.sysprocesses

——6)From sp_readerrorlog SP

  sp_readerrorlog 0,1,’Copyright (c)’

——7)From dm_os_sys_info

SELECT sqlserver_start_time FROM sys.dm_os_sys_info

——8)From dm_exec_sessions

SELECT login_time FROM sys.dm_exec_sessions WHERE session_id = 1

——9)From traces

SELECT start_time from sys.traces where is_default = 1

——10)From sp_helpdb

sp_helpdb ‘tempdb’


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s