Terminate (kill) a specific session on a server

Azure SQL Database provides a command to kill a specific session on a server.

Find session ID

First we will identify the session we want to end. We do this by listing all sessions on the server with this query:

exec sp_who

Result

Kill session

Now we will use the session ID (spid) to kill a session (111 in the example):

kill 111

Result

Azure SQL Database ends the provided session ID and rolls back all transactions that are associated with it. This operation may take a while.