November 15, 2001 at 7:23 am
Hi Everyone!
Our C++ programmers have asked me to post a question.
They are using asynchronous and synchronous queries (got me there).
Anyone know what command can be sent to SQL to stop the execution of a query in progress (but only that query of course)? (Similar to clicking the stop button in the query analyzer.)
I have checked for cancel and some other keywords but nothing really addresses this.
Thanks!
November 15, 2001 at 5:32 pm
Are these queries taking minutes to execute? Most queries should only take a second or two tops. Are you running update queries or just selects?
If you set the commmand timeout property, if using ADO, to a very short interval, the query will terminate when that amount of time is reached.
November 15, 2001 at 6:14 pm
I havent worked much with asynchronous queries - will have to look! Are they using ADO, ODBC, ??
Andy
November 15, 2001 at 7:03 pm
you could send a kill <spid> command from another connection. It will close the connection <spid> if at all possible.
Cursors never.
DTS - only when needed and never to control.
November 16, 2001 at 8:36 am
I found out from the programmers that they use one thread in asycronous mode for everything and you cannot stop the query once it starts.
But I liked the idea of the kill command. I may bring it up to him...
Thanks again everyone!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply