Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

when was sql server stopped? Expand / Collapse
Author
Message
Posted Monday, June 26, 2006 8:11 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Sunday, August 4, 2013 11:06 AM
Points: 397, Visits: 548

Is there way to tell when was sql server stopped? I know i can look in the sql server logs but that only tells me when sql server was started.

 

thanks

Post #290091
Posted Monday, June 26, 2006 8:18 AM
UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Monday, July 7, 2014 1:06 PM
Points: 1,478, Visits: 1,025

Look on the server's application log in event viewer.

Post #290096
Posted Monday, June 26, 2006 8:20 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Sunday, August 4, 2013 11:06 AM
Points: 397, Visits: 548
is there any table that I can query? I dont have access to the box sql server is running on.
Post #290097
Posted Monday, June 26, 2006 10:11 AM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Friday, January 17, 2014 11:05 AM
Points: 779, Visits: 222
xp_readerrorlog will display the last error log. Then you can feed it integer parameters to see the previous logs.

exec master.dbo.xp_readerrorlog 1

That will show the last log generated before the current one, your stop request should be the final row.
Post #290131
Posted Monday, June 26, 2006 10:25 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Tuesday, July 8, 2014 12:24 PM
Points: 3,475, Visits: 579

Theoretically the last record should show the request to stop.

This will also work:

Copy the following VB Script code to Notepad, save for example as C:\CheckSQLStop.vbs and run either by itself on the server or specifying the machine name if you have admin rights (that you don't have as you say) or running in Query Analyzer which will execute as SQL Server startup account. This will work on Windows XP and Windows 2003 

xp_cmdshell "cscript C:\CheckSQLStop.vbs"

' Code for CheckSQLStop.vbs

' This is modified example from Scriptomatic Tool - generated code

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_NTLogEvent where " _
& "Logfile = 'Application' and eventcode = '17147'",,48)
For Each objItem in colItems
    Wscript.Echo "Category: " & objItem.Category
    Wscript.Echo "CategoryString: " & objItem.CategoryString
    Wscript.Echo "ComputerName: " & objItem.ComputerName
    Wscript.Echo "Data: " & objItem.Data
    Wscript.Echo "EventCode: " & objItem.EventCode
    Wscript.Echo "EventIdentifier: " & objItem.EventIdentifier
    Wscript.Echo "EventType: " & objItem.EventType
    Wscript.Echo "InsertionStrings: " & objItem.InsertionStrings
    Wscript.Echo "Logfile: " & objItem.Logfile
    Wscript.Echo "Message: " & objItem.Message
    Wscript.Echo "RecordNumber: " & objItem.RecordNumber
    Wscript.Echo "SourceName: " & objItem.SourceName
    Wscript.Echo "TimeGenerated: " & objItem.TimeGenerated
    Wscript.Echo "TimeWritten: " & objItem.TimeWritten
    Wscript.Echo "Type: " & objItem.Type
    Wscript.Echo "User: " & objItem.User
Next

 




Regards,
Yelena Varshal

Post #290134
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse