RE: [PHP-WIN] Canceling a Query

From: Date: Thu, 17 May 2001 19:09:32 +0000
Subject: RE: [PHP-WIN] Canceling a Query
Groups: php.windows 
Request: Send a blank email to php-windows+get-7694@lists.php.net to get a copy of this message
Dear Brinkman, First I wonder one thing: Why are the queries long running in the first place? Might it be because improper indexing of the attribute in the tables? Maybe it can be worth to have alook at this to see if you can increase performance this way. You might very well be able to speed up the execution of your queries by rewriting them and/or adding a few more new indexes to the table. I know that within the SQL server one are able to track user process, create new jobs, and delete jobs, and a thought around this - which is untried by me - might be to uses these facilities provided by SQL server, and build a kind of tracking system that keeps track of the users queries with a kind of "ticket", when a user sends a cancel request, you simply forward this cancel message with the proper "ticket" to SQL server, and then you lets the RDBMS do the killing of the long running process. How ever I haven't done this my self, and don't even know if it possible, but it might very well be worth in your case to have a lock at it. In the SQL help, you might start out by checking out sp_add_jobb and sp_delete_job. Cheers, /Anders >-----Original Message----- >From: Brinkman, Theodore >[mailto:Theodore.Brinkman@standardregister.com] >Sent: Wednesday, May 16, 2001 5:45 PM >To: php-windows@lists.php.net >Subject: [PHP-WIN] Canceling a Query > > >I'm working on an application for work where users will be querying the >database to get information back about processed documents. >I'm trying toset up a way for a user to cancel a query which is taking too >long. I'm using MS SQL Server 2000. The interface for the cancel is >easy enough, a form containing a button that says 'cancel' and a value or set >of values identifying the query being run. > >I've found 'KILL <SPID>', but the problem is that all the >connections to the >database are done through the web-server so they get the same >SPID, which >means that EVERY query being run by EVERY user gets killed. >(Obviously not >an acceptable solution.) Does anybody out there know of a way to >specifically kill a single query/stored procedure? We're >willing to track >as many values as necessary to do it. > >Thanks. > > - Theo > >-- >PHP Windows Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net >For additional commands, e-mail: php-windows-help@lists.php.net >To contact the list administrators, e-mail: >php-list-admin@lists.php.net >

« previous php.windows (#7694) next »