Stopping SQL Server

You can stop SQL Server locally from the server or remotely from a client or another server. If you've started SQL Server as a service, you can stop it by using SQL Enterprise Manager, SQL Service Manager, the Services application in the Control Panel, or the net stop mssqlserver command. If you've started SQL Server from the command line, you can stop SQL Server from a client (either locally or remotely) by using the SHUTDOWN command. You can stop SQL Server from a command prompt window by pressing ctrl c.

When you use any of these procedures to stop SQL Server, SQL Server shuts down in an orderly fashion by performing the following steps:

In addition, if you stop SQL Server from a client, SQL Server waits for any currently executing Transact-SQL statements or stored procedures to finish. To bring the system to an immediate halt, you must issue the statement SHUTDOWN WITH NOWAIT from a client.

When you plan to shut down SQL Server, it's a good idea to first pause the SQL Server service and then broadcast a message that SQL Server will be stopped. Give users enough time to finish their current tasks, and then shut down SQL Server as described in the preceding section.

    To stop SQL Server using SQL Service Manager
  1. From the Microsoft SQL Server 6.0 program group, start SQL Service Manager.

    The SQL Service manager Window appears.

  2. To stop a remote SQL Server, in the Server box, select or enter the name of the remote server, and then choose the Connect button.
  3. From the Service box, select MSSQLServer.
  4. Choose the yellow Pause light to pause the service.
  5. Send a message informing connected users that the server will soon be shutting down. After an appropriate interval, proceed to step 6.
  6. Choose the red Stop light.
    To stop SQL Server using SQL Enterprise Manager
  1. From the Microsoft SQL Server 6.0 program group, start SQL Enterprise Manager.

    The SQL Enterprise Manager Window appears.

  2. From SQL Enterprise Manager's Server Manager window, open a server group and select a server.
  3. From the toolbar, select the Services icon (the stoplight).
  4. Choose the yellow Pause light to pause the service.
  5. Send a message informing connected users that the server will soon be shutting down. After an appropriate interval, proceed to step 6.
  6. Choose the red Stop light.
  7. Choose the Done button.
    To stop SQL Server from operating-system prompt
    To stop SQL Server from an isql client
    To broadcast a shutdown message

You can also stop SQL Server locally from the server by using the Services application in the Control Panel. For more information, see your manuals for Windows NT.