Starting/stopping SQL via DMO

  • How can I use VBScript (and DMO) to stop the SQL Service service on a remote SQL 7 machine, copy trans logs from that machine, and then restart the SQL service?

  • Here is a starting point for you. See what you can do with this:

    On Error Resume Next

    Set oServer = New SQLDMO.SQLServer

    With oServer

    .LoginSecure = True

    .Connect "."

    .Shutdown

    End With

    Set oServer = Nothing

    'do the file copy here

    Set oServer = New SQLDMO.SQLServer

    oServer.Start False, "."

    Set oServer = Nothing

    Andy

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply