SHUTDOWN (TSQL Statement)

stops the server.

Syntax

SHUTDOWN [ WITH NOWAIT ]

Arguments

WITH NOWAIT
the server is terminated abruptly.

Remarks

Only sa is allowed to execute this statement.

The statement SHUTDOWN waits for the running workers to finish, and stops the server.

If some workers are still running after one minute, the server is terminated abruptly.

In case of heavy load, there is no guarantee that the batch containing the SHUTDOWN command will be processed immediately.

So, it is often better to use the systemd systemctl stop command on the shell to terminate the server, because it will be processed immediately.