Home > Archive > Microsoft SQL Server forum > September 2005 > Stopping Query Execution from PHP









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Stopping Query Execution from PHP
Ranjith

2005-09-27, 7:23 am

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.

Simon Hayes

2005-09-27, 9:23 am

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
example.

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

Simon

dbahooker@hotmail.com

2005-09-28, 11:23 am

can't you just use query analyzer?

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com