Kill all processes for specific database on Microsoft SQL Server
Problem: How to kill all processes on Microsoft SQL Server database ? Solution: Applied to: Microsoft SQL Server Execute the follow query on master database and change ‘MyDB’ with your DB: DECLARE @kill varchar(8000) = ”; SELECT @kill = @kill + ‘kill ‘ + CONVERT(varchar(5), spid) + ‘;’ FROM master..sysprocesses WHERE dbid = db_id(‘MyDB’) EXEC(@kill); Best Regards, …
Kill all processes for specific database on Microsoft SQL ServerLeggi altro »