This question has came up many quite a few times with our development team as well as emails I have received about how to stop SQL Server immediately (due to accidentally ran t-sql, business logic or just need of to stop SQL Server using T-SQL).
Answer is very simple, run following command in SQL Editor.
SHUTDOWN
If you want to shutdown the system without performing checkpoints in every database and without attempting to terminate all user processes use following command.
SHUTDOWN WITH NOWAIT
Server can be turned off using windows services as well. SHUTDOWN permissions are assigned to members of the sysadmin and serveradmin fixed server roles.
Reference : Pinal Dave (https://blog.sqlauthority.com) , BOL