Thursday, October 24, 2013

SQL query to kill the suspended queries

Here is the code to kill the suspended queries

--Get the suspended queries from the current database 
select spid, kpid, login_time, last_batch, status, hostname, nt_username,
 loginame  from sys.sysprocesses where status = 'suspended'
--Kill the suspended query with specifing spid . example i took 78
kill 78