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.
The SQL Service manager Window appears.
The SQL Enterprise Manager Window appears.
net stop mssqlserver
SHUTDOWN [WITH NOWAIT]
Issuing SHUTDOWN waits for currently executing Transact-SQL statements or stored procedures to finish before shutting down. Issuing SHUTDOWN WITH NOWAIT brings the system to an immediate halt.
net send /users "message"
For example:
net send /users "SQL Server is going down in 20 minutes. Please disconnect."
The /users option causes the specified message to be sent to all users connected to the server. For descriptions of other net send options, see your manuals for Windows NT.
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.