hi,
I want to know how to programmatically find out when the sql server service started?
Sql Server Service
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Kunal Naik163 reputationPosted Apr 5, 2012, 10:06 PM EDT
There is one simple but awkward method is there to find out when the SQL server service is started.
The following query will give you the time when the SQL server service is started;
select crdate from [master].dbo.sysdatabases
where name='tempdb'
This is because, the tempdb will be created whenever SQL server service is started or restarted.
SELECT login_time FROM sys.dm_exec_sessions WHERE session_id = 1
will give you a
datetimefor when the server was started.Hope this will helps you.