Solved

Kill a Thread Id in Sql

Posted on 2002-05-02
1
1,753 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
Comment Utility
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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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…

728 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

14 Experts available now in Live!

Get 1:1 Help Now