- DECLARE @DatabaseName nvarchar(50)
- --Set the Database Name
- SET @DatabaseName = N'TESTDB'
- --Select the current Daatbase
- SET @DatabaseName = DB_NAME()
- DECLARE @SQL varchar(max)
- SET @SQL = ''
- SELECT @SQL = @SQL + 'Kill ' + Convert(varchar, SPId) + ';'
- FROM MASTER..SysProcesses
- WHERE DBId = DB_ID(@DatabaseName) AND SPId <> @@SPId
- and spid IN (SELECT blocked FROM master.dbo.sysprocesses)
- exec @SQL
Tuesday 9 January 2018
How to Kill all the Blocked Processes of a Database
Subscribe to:
Post Comments (Atom)
Upload valid file in C#
protected bool CheckFileExtandLength(HttpPostedFile HtmlDocFile) { try { Dictionary<string, byte[]>...
-
CREATE TAblE #temp ( T_Name VARCHAR(50), T_Times BIGINT ) INSERT INTO #temp(T_Name,T_Times) VALUES ('ASHISH',4) IN...
-
Step 1: Open URL: https://portal.azure.com/#home Step2 : Click Manage Azure Active Director Step3: Click Enterprise Application Step 4: Ne...
-
Injection Injection flaws, such as SQL injection, LDAP injection, and CRLF injection, occur when an attacker sends untrusted data to an ...
No comments:
Post a Comment