SQL Server - Is it possible to stop query execution?

Asked By MatteoGugliott on 29-May-07 05:40 AM
Hello,

I'm using reporting services 2005 and I have reports using long running
queries.
If a user stop the report execution (by pressing the Stop button in the
browser or by closing the browser) I see that the query is still running on
the server.

Is the a way to stop the query execution when the user choose to stop the
report?
Maybe adding a stop button in the page to stop the execution...
Is it something feasible or impossible due to the architecture?

Many Thanks in advance
Matteo Gugliotta




Ayman replied on 29-May-07 07:55 AM
The query takes time to stop even if you do it from the sql server
management studio.  Try optimizing your scripts or using filters for
the results.
MatteoGugliott replied on 29-May-07 08:06 AM
Thanks for the reply.
Do you mean that there is already a RS mechanism that stops the process on
the server when the user stop the report?

thanks again.
Matteo

--
Matteo Gugliotta
Ayman replied on 29-May-07 09:48 AM
On May 29, 8:06 am, Matteo Gugliotta

I believe so, it just takes a bit of time for the process to stop even
with scripts you run directly on SQL Server.  Is the server local?
Most likely it is lagging from the network side.  Also, like I said,
use parameters to filter the report so that the results are less and
make sure you do not put all the results on one page!  Another
suggestion, make most computations, etc on the Server side through
procedures, functions, or views.  It's easier than coding everything
in RS and makes it more efficient.  Hope that helps.
MatteoGugliott replied on 29-May-07 09:58 AM
yes, the server is local.
Data comes from a complex stored procedure that takes some minutes to do
everything...
Elaboration in the report is minimal.

Thanks anyway for your toughts.

--
Matteo Gugliotta