Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Kill a Thread Id in Sql

Posted on 2002-05-02
1
Medium Priority
?
1,787 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 600 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

877 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