Kill Session

When deadlock happen using this quires. i found the user and kill that session

Kill session

 –FIND KILLING SPID
SELECT
hostname,*
— net_library,
— net_address,
— client_net_address

FROM sys.sysprocesses AS S
INNER JOIN sys.dm_exec_connections AS decc ON S.spid = decc.session_id
WHERE S.open_tran=1
–WHERE spid = @@SPID –this query only check your session if hide its check all –session
–KILL 60

 

 

Advertisements

Author: tdmsql

I am a PL-Sql Developer. I am searching some sites sql studies but its bored. i like create studies note my own way. so that i created this site.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s