how to tell when sql service starts and restarts... log

i can use query or whatever.

last night we came across our sql service stopped around 8 o clock last night.
what is an easy way to tell when the sql service stopped and started by either logs or queries.
thanks guys
jamesmetcalf74Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Deepak ChauhanSQL Server DBACommented:
You can check the Windows event system logs
event ID 7036
message :The SQL Server (XYZ) service entered the stopped state.

and same event ID 7036
Mesasge: The SQL Server (XYZ) service entered the running state

or check the sql server error log file recycling time.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott PletcherSenior DBACommented:
A very quick and easy to tell that it started since the last stop is to capture the create_date for the tempdb into a table, then compare that value to the current value: if there is a change, then the SQL instance has started since the last time you checked.  Then you could do the more costly checks to determine when it stopped.
0
Mandeep SinghDatabase AdministratorCommented:
Hi,

Check this post, here it will tell you uptime of server.

http://hightechnology.in/how-to-know-uptime-of-sql-server-by-tsql/
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
In SSMS just check for the SQL Server logs. First entry of the first file (Current) is the Start Time and last entry from the previous file (Archive #1) is when the SQL Server stopped.

MSSQL-logs.PNG
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.