?
Solved

How to terminate a processes in MS SQL Server

Posted on 2007-11-27
10
Medium Priority
?
1,146 Views
Last Modified: 2008-09-08
Hi All,
I am not able to terminate a process which is locking more than 2 day's. I have tried to terminate the process, but I cant. Still the job is running. This process lock other processes.

How could i terminate the process without reboot?
0
Comment
Question by:Srikanthsubramanian
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
10 Comments
 
LVL 51

Expert Comment

by:Vitor Montalvão
ID: 20356467
In SQL Query Analyzer run command KILL. Ex:
Kill [ProcessNumber]
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 20356507
>I have tried to terminate the process,
How did you try ? Did you use "KILL"  statement , otherwise try it

as a second option, stop SQL Server Agent service

and if it is still running, restart the SQLServr service  or else restart the machine.
0
 
LVL 51

Expert Comment

by:Vitor Montalvão
ID: 20356551
You  must be careful if it's a production enviroment and you going to stop SQL Server Agent or SQL Server service. And be more careful if you have more databases in that instance. You'll stop ALL jobs and ALL databases will became offline.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Srikanthsubramanian
ID: 20356585
Hi am expecting alternate option. I have planed to restart the service end of day. Is there any way to terminate the process without reboot?
0
 
LVL 5

Expert Comment

by:MrNetic
ID: 20356609
Srikanthsubramanian,

You should check if it is in a middle of a rollback, you could make inconcistencies in the DB...
What is the outpup of KILL SPID WITHSTATUSONLY .
0
 
LVL 5

Accepted Solution

by:
MrNetic earned 500 total points
ID: 20356642
What is the outpup of KILL SPID WITH STATUSONLY .
What is the SQL SERVER VERSION ( select @@version )?
0
 
LVL 7

Assisted Solution

by:macentrap
macentrap earned 500 total points
ID: 20356666
along with MrNetic advise, on Kill Spid withstatusonly ( might be in Rollback state)

this might help (I have used in only twice)
http://grahambrooks.blogspot.com/2007/06/terminate-sql-server-processes-for.html
0
 

Author Comment

by:Srikanthsubramanian
ID: 20364174
I tried lot of times but not able to terminate the processes. This has been resolved after reboot.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question