Server status with SMO

  • Hi everyone!

    I need to upgrade an application from DMO to SMO. With DMO I can check the status of the SQL Server with Server.Status property. But I cannot find a replacement for this property in SMO.

    Does anyone knows how to retrieve the status of the SQL Server.

    Regards.

  • I think this is what you are looking for.

    Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer.Services

    Look here.

  • Thank you webooth. Do you know how to open an instance that is not on local machine? i.e. what should I type in MSSQLSERVER?

    svc = mc.Services("MSSQLSERVER")

    Thanks again.

    Zubeyir

  • MSSQLSERVER is the name of the service.

     

    To connect to anothet machine use something like this

     

    Dim

    mc As Wmi.ManagedComputer

    mc =

    New Wmi.ManagedComputer("computer name")

     

    Look at this example.

     

     

Viewing 4 posts - 1 through 3 (of 3 total)

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