More About Using the SHUTDOWN Statement

If SQL Server Enterprise Manager or SQL Server Service Manager is not available, you can stop Microsoft® SQL Server™ by issuing a SHUTDOWN command from osql or another query tool.

The SHUTDOWN statement minimizes automatic recovery time when you restart SQL Server. The SHUTDOWN statement stops SQL Server in this manner:

  1. Logins are disabled (except for the system administrator login). To see a list of all current users, use the sp_who system stored procedure.
  2. Transact-SQL statements or stored procedures that are running are allowed to finish. To see a list of all active processes and locks, use the sp_who and sp_lock system stored procedures.
  3. A CHECKPOINT is performed in every database.

Note Issuing the SHUTDOWN WITH NOWAIT statement stops the server immediately. However, it requires more recovery time the next time the server is started because no CHECKPOINT is issued against any databases.


To stop SQL Server immediately

See Also

SHUTDOWN


(c) 1988-98 Microsoft Corporation. All Rights Reserved.