MSSQL中的KILL SPID命令
Tags: kill sessionMSSQLSQL Server杀会话
This article gives an overview of the KILL SPID command and how to monitor the rollback progress.
本文概述了KILL SPID命令以及如何监视回滚进度。
介绍 (INTRODUCTION)
Once we connect to a SQL Server instance, it assigns a unique identification number to each connection. It is the Server Process ID and commonly known as SPID. SPID 1 to 50 is reserved for SQL Server internal processes, and the user process starts from SPID 51.
一旦连接到SQL Server实例,它将为每个连接分配一个唯一的标识号。 它是服务器进程ID,通常称为SPID。 SPID 1到50保留用于SQL Server内部进程,而用户进程从SPID 51开始。
在SQL SERVER中检查SPID的不同方法 (DIFFERENT WAYS TO CHECK THE SPID IN SQL SERVER)
You can check all processes in SQL Server using the following ways.
您可以使用以下方法检查SQL Server中的所有进程。
使用SP_WHO2命令: (USING SP_WHO2 COMMAND:)
Execute the sp_who2 command, and it lists out all the SPID’s including the system and user processes.
执行sp_who2命令,它列出了所有SPID,包括系统进程和用户进程。
使用动态管理视图: (USING DYNAMIC MANAGEMENT VIEW:)
We can use the DMV sys.dm_exec_sessions to get the session details.
我们可以使用DMV sys.dm_exec_sessions来获取会话详细信息。