question

nadipineni avatar image
nadipineni asked

how to find out the when the sql server service was stopped?

sql-server-2005sql-server-log
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

nadipineni avatar image nadipineni commented ·
i want to be log report when the sql server was stopped?
0 Likes 0 ·
Cyborg avatar image
Cyborg answered
Few methods.... Check tempdb created date in SQL Server databases. Using sys.dm_os dmv
SELECT sqlserver_start_time FROM sys.dm_os_sys_info;
4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sp_lock avatar image sp_lock commented ·
Also, you have the SQL log if you dont reg recycle them
0 Likes 0 ·
nadipineni avatar image nadipineni commented ·
Using sys.dm_os dmv SELECT sqlserver_start_time FROM sys.dm_os_sys_info; i execute the above command it's showing below error. Msg 102, Level 15, State 1, Line 2 Incorrect syntax near '.'.
0 Likes 0 ·
Cyborg avatar image Cyborg commented ·
sqlserver_start_time is a new column added in SQL Server 2008.
0 Likes 0 ·
ThomasRushton avatar image ThomasRushton ♦♦ commented ·
I've just tested the query in SQL2005 on my local machine, and didn't get a syntax error, but Msg 207, Level 16, State 1, Line 3 Invalid column name 'sqlserver_start_time'. Not sure what my point is here... ;-)
0 Likes 0 ·
ThomasRushton avatar image
ThomasRushton answered
Assuming SQL Server isn't running... Check the Windows Event Log (Application log). EventID 17148 shows shutdowns initiated by the Service Control Manager. I don't know what other options there are - I haven't looked. Yet. You could also check the most recent timestamp / modified date of the SQL Server Logs (no, not the database logs, but the log files that SQL Server writes out).
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.