INF: Starting SQL Server Remotely from the NT Command Prompt

Article translations Article translations
Article ID: 125627 - View products that this article applies to.
This article was previously published under Q125627
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

On This Page

SUMMARY

The SQL Service Manager provides a way to remotely start and stop SQL Server. However, the SQL Service Manager cannot be used to start and stop SQL Server from a batch file or Windows NT Command Prompt. The AT scheduler from Windows NT, the Remote Command Server, NETSVC service from the Windows NT version 4.0 Resource Kit, and Terminal Server service in Microsoft Windows 2000 allow the ability to start and stop services from the NT Command Prompt, provided that you have privileges to start and stop services on the remote machine.

MORE INFORMATION

To Use the NETSVC

To stop SQL Server running on a server named 'MYSQLServer', install the Resource Kit onto the remote computer, and then run NETSVC on the remote computer that is used to control the SQLserver 'MYSQLServer' using the following command:
NETSVC "mssqlserver" \\MYSQLServer /stop
For additional help, type the following:
NETSVC /?

To Use Terminal Server

If SQL Server is running on a Windows 2000 computer, install Terminal Server service on the Windows 2000 computer and then install the Terminal Server client on the remote computer. The remote computer can be running either Windows NT 4.0 or Windows 2000.

To Use the AT Scheduler

NOTE: This method will not work in a batch file, because you need to know the current time of the remote machine.
  1. Start the Schedule service on the remote machine.
  2. Run the following NET TIME command to check the current time on the remote machine.
    NET TIME \\<Remote Machine>
  3. Run the following AT command to schedule the desired program to run on the remote system about 1-2 min. in the future:
    AT \\<Remote Machine> <Time> <Command>
For example, if you want to be able to stop SQL Server remotely on a machine named NT35Server. Start the Schedule service on NT35Server. Check the time of NT35Server. For this example, let's say it was 12:00pm. Then run AT on the machine that you want to control the machine NT35Server with as follows:
AT \\NT35Server 12:02:00pm NET STOP SQLSERVER

Properties

Article ID: 125627 - Last Review: February 28, 2014 - Revision: 3.3
APPLIES TO
  • Microsoft SQL Server 4.21a Standard Edition
  • Microsoft SQL Server 6.5 Standard Edition
  • Microsoft SQL Server 7.0 Standard Edition
  • Microsoft SQL Server 2000 Standard Edition
Keywords: 
kbnosurvey kbarchive kbinfo KB125627

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com