By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,688 Members | 1,738 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,688 IT Pros & Developers. It's quick & easy.

Stopping Query Execution from PHP

P: n/a
We have a console.php which takes in SQL queries and displays them in a
result.php webpage.

Sometimes the query takes minutes to execute or crashes the PHP
application. Is it possible to cancel a query during execution?

If yes, how does one go about it.

The PHP Console is used by multiple users simultaneously.
The queries are executed on a Remote Database.

Sep 27 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
That probably depends on what client library you're using to connect to
MSSQL - ADO has Cancel and CancelBatch methods, for example, as well as
a CommandTimeout property. Also see "query governor cost limit Option"
in Books Online - you can configure the server not to run queries which
exceed a certain estimated cost. If your application crashes (ie. the
connection is closed) MSSQL will automatically clean up the connection
and roll back any transactions.

If you have stability problems, and given the security problems around
letting users submit arbitrary SQL queries, you might also consider
using a reporting application to retrieve the results (if reporting is
your goal, of course) - Reporting Services is free with MSSQL, for

If this doesn't help, I suggest you give some more information about
your environment - MSSQL version, client library etc.


Sep 27 '05 #2

P: n/a
can't you just use query analyzer?

Sep 28 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.