Solved

Kill a Thread Id in Sql

Posted on 2002-05-02
1
1,761 Views
Last Modified: 2007-12-19
I have a vb application who call one StoreProcedure. This SP update the db with some information, this sp take about 15min. to finish it's work and one person can call it 2-3 times in 5 minutes.They can be more then 1 person who call this sp at same time. People can stop and restart a thread of this SP.

For ex. I have 2 people connected

Spid 1 & Spid 2

Spid 1 have 2 thread (kpid 11 & Kpid 12)
Spid 2 have 3 thread (kpid 21, 22, 23)

If Spid 1 want to kill only Kpid 12, how can i do that. For now, i'm only able to kill Spid 1 but this will kill all Kpid for this user.

0
Comment
Question by:JokerTanant
1 Comment
 
LVL 2

Accepted Solution

by:
ykchakri earned 150 total points
ID: 6987205
It is not possible to kill a specific kpid using 'kill' command (or any command for that matter). And it is not advisable to do so. SQL server will divide long running transactions into multiple threads and process them parallelly and joins all threads at the end of the transaction.

If you kill one of these threads, it leaves your transaction in an inconsistent state.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

828 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