Solved

Kill a Thread Id in Sql

Posted on 2002-05-02
1
1,774 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
[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
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

Technology Partners: 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!

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
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.
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 UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

622 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