Solved

How to terminate a processes in MS SQL Server

Posted on 2007-11-27
10
1,131 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
  • 2
  • 2
  • 2
  • +2
10 Comments
 
LVL 47

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 47

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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

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 125 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 125 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

813 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now