SQL Query to Release lock on database


On October 07

SQL Query to Release lock on database


 

1. First find out the Lockin ID with the following query:

SELECT
     blocking_session_id AS BlockingSessionID,
     session_id AS VictimSessionID,

     (SELECT [text] FROM sys.sysprocesses
      CROSS APPLY sys.dm_exec_sql_text([sql_handle])
      WHERE spid = blocking_session_id) AS BlockingQuery,

     [text] AS VictimQuery,
     wait_time/1000 AS WaitDurationSecond,
     wait_type AS WaitType,
     percent_complete AS BlockingQueryCompletePercent
FROM sys.dm_exec_requests
CROSS APPLY sys.dm_exec_sql_text([sql_handle])
WHERE blocking_session_id > 0

 

2. Then kill the Locking id with the following query :

     KILL 63

 

 

You may also like :

Basic steps to implement ASP dotnet MVC using Entity Framework Code First approach
SQL Query to Release lock on database
How to change URL withought page postback
Csharp Code to make call By connecting you phone to PC
BE Electronics ETC IT Computer Project Titles - Group 1
SQL Query to Split string by specific seperator
Simple Page Method in asp.net
Error 720 Resolution
Queries in LINQ to DataSet
BEWARE-XSS THIEVES ARE LOOKING FOR YOU
how to search date within range in c Sharp dot net and mssql

You may also like :





Responses