This sample illustrates using SQL Distributed Management Objects (SQL-DMO) objects supplied with Microsoft® SQL Server™ 2000. This Microsoft® Visual Basic® sample demonstrates how to use the SQLServer object to check the status of the service, and to start and stop it.
This sample does not have all error trapping necessary to use in a production environment where servers may or may not be running, paused, or stopped. It also uses server groups to locate the available servers, therefore it assumes that the machines hosting those servers are running.
C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Samples\Sqldmo\Vb\Service