SCMControl

Transact-SQL Samples

Samples

SCMControl

This sample illustrates using SQL Service Control Manager (SQL-SCM) to query and change the execution state of the following services on a local computer:

  • Microsoft® SQL Server (MSSQLServer)

  • SQL Server Agent (SQLServerAgent)

  • MS DTC (MSDTC)

SQL Service Control Manager (SQL-SCM) is an API supporting control of the Microsoft® SQL Server™ and related services for Microsoft Windows® 95/98 and Microsoft Windows NT®.

This Microsoft® Visual C++® sample uses the w95scm.dll to get the status of and control various SQLServer services. The sample is a console application. Using this sample, you can:

  • Start the SQL Server (MSSQLServer), SQL Server Agent (SQLServerAgent) or MS DTC (MSDTC) services on the local computer.

  • Pause and continue the MSSQLServer service.

  • Stop a supported service.

  • Query a supported service to determine its current execution state.
Default Location

C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Samples\Misc\Scm\SCMControl

Running the Sample

To run this program, open SCM.dsw workspace and compile the program. Make sure the w95scm.dll is in the execution path.

See Also

SQL-SCM Samples