Killing Active Process in SQL Server 2008

In this article I will explain, how to kill active SQL Server DB Connections.
  • 3138

Introduction

When you are performing database level operations, and that environment is shared between multiple users. Some errors may come, like- xxxx operation could not be performed, database is in use. This problem arises due to having active connections to your database. To kill current current process we have following method to kill active SQL Server DB Connections.

Technique-I

  1. Open SQL Server Management Studio.
  2. Open Object Explorer and go to Activity Monitor by right-click on the connection item.
    ActiveMonitor-in-sql.jpg

  3. Select the process .
    Killing-process.jpg

  4. Right click on the process which you want to kill and select Kill Process.

Killing_process.jpg

Technique-II

Another method to kill active SQL Server DB connections is using kill command. Run below query, it will show you all running processes.

list_all_activeProcesses.jpg

To use "kill" keyword, simply type "kill" and type SPID. This command is used against SPID (Server Process ID). Space should be there between "kill" keyword and SPID.

Killing_selected_process.jpg

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.