Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Cancelling a Stored Procedure................

Author  Topic 

KnooKie
Aged Yak Warrior

623 Posts

Posted - 2003-02-07 : 07:03:02
Just wondering if there is any way of cancelling a stored procedure once it has started running ??

the reason i ask is that we have a number of search facilities some of which can potentially search for quite a while depending on the criteria entered by the user. Occasionally someone will enter something that encompasses so much that the search can go on for to long and i would like if possible to provide some way for them to cancel the search. The problem is that the searches are stored procedures running.

using SQL 7 with VB6 front-end

The other way i was thinking was perhaps getting the stored procedure(s) to return a 100 records at a time so i can use VB to initiate the cancell operation ?

thanks for any help

===========
Paul

Edited by - KnooKie on 02/07/2003 07:23:03

Andraax
Aged Yak Warrior

790 Posts

Posted - 2003-02-07 : 07:30:57
There is a cancel() method for the connection object in ADO. Have you tried that??

Go to Top of Page

KnooKie
Aged Yak Warrior

623 Posts

Posted - 2003-02-07 : 07:32:57
nope i will look into it


thankyou

===========
Paul
Go to Top of Page

Bambola
Posting Yak Master

103 Posts

Posted - 2003-02-07 : 08:14:23
try

SET QUERY_GOVERNOR_COST_LIMIT value

where value is an int indicating seconds.
If estimated run time is bigger then the value you specify, it would not run.

Go to Top of Page

simondeutsch
Aged Yak Warrior

547 Posts

Posted - 2003-02-08 : 22:48:34
Set the Commandtimeout property in ADO to time out a stored proc for a command object.

Sarah Berger MCSD
Go to Top of Page
   

- Advertisement -