Showing posts with label cancel. Show all posts
Showing posts with label cancel. Show all posts

Monday, March 12, 2012

How to cancel report?

Hi,
I have an application with RS reports. When user runs a report, I want to
have a button Cancel Report. I can find the jobID for this report and cancel
it, but cursor on IE is still an hourglass and green circle with the text
"Report is being generated" are still in the center of the browser. Is there
any way to let RS know that it should stop to do everything for this session
because current job is already cancelled?
Maybe I even can get some feedback from RS that it is cancelled and I can
suppress my Cancel button?
Any suggestions?
Thanks.
Victor
P.S. If Microsoft guys will read this: Are we going to have in the future
Cancel button?
Thanks.Anybody... Anything...
"Victor" wrote:
> Hi,
> I have an application with RS reports. When user runs a report, I want to
> have a button Cancel Report. I can find the jobID for this report and cancel
> it, but cursor on IE is still an hourglass and green circle with the text
> "Report is being generated" are still in the center of the browser. Is there
> any way to let RS know that it should stop to do everything for this session
> because current job is already cancelled?
> Maybe I even can get some feedback from RS that it is cancelled and I can
> suppress my Cancel button?
> Any suggestions?
> Thanks.
> Victor
> P.S. If Microsoft guys will read this: Are we going to have in the future
> Cancel button?
> Thanks.
>

How to cancel a processing request?

Hello ,

I've execute a wrong sql request from an ETL. This request is inserting lots of rows in a table. I want to cancel that process, is it possible to do this? If yes, how can I cancel that request?

Thanks,

Stop or 'kill' the client application that is doing the inserts.|||

Find out the SPID that the request is running on, and then run KILL <thespidnumber>

You can probably find the SPID by running the query below, or by using sp_who2

SETNOCOUNTON;

DECLARE @.SpID smallint

DECLARE spID_Cursor CURSOR

FORWARD_ONLYREAD_ONLYFOR

SELECTTOP 25 spid

FROM master..sysprocesses

WHEREstatus='runnable'

AND spid > 50 -- Eliminate system SPIDs

AND spid <> 102 -- Replace with your SPID

ORDERBY CPU DESC

OPEN spID_Cursor

FETCHNEXTFROM spID_Cursor

INTO @.spID

WHILE@.@.FETCH_STATUS= 0

BEGIN

PRINT'Spid #: '+STR(@.spID)

EXEC('DBCC INPUTBUFFER ('+ @.spID +')')

FETCHNEXTFROM spID_Cursor

INTO @.spID

END

-- Close and deallocate the cursor

CLOSE spID_Cursor

DEALLOCATE spID_Cursor

|||thx more than I expected

How to cancel a processing request?

Hello ,

I've execute a wrong sql request from an ETL. This request is inserting lots of rows in a table. I want to cancel that process, is it possible to do this? If yes, how can I cancel that request?

Thanks,

Stop or 'kill' the client application that is doing the inserts.|||

Find out the SPID that the request is running on, and then run KILL <thespidnumber>

You can probably find the SPID by running the query below, or by using sp_who2

SETNOCOUNTON;

DECLARE @.SpID smallint

DECLARE spID_Cursor CURSOR

FORWARD_ONLYREAD_ONLYFOR

SELECTTOP 25 spid

FROM master..sysprocesses

WHEREstatus='runnable'

AND spid > 50 -- Eliminate system SPIDs

AND spid <> 102 -- Replace with your SPID

ORDERBY CPU DESC

OPEN spID_Cursor

FETCHNEXTFROM spID_Cursor

INTO @.spID

WHILE@.@.FETCH_STATUS= 0

BEGIN

PRINT'Spid #: '+STR(@.spID)

EXEC('DBCC INPUTBUFFER ('+ @.spID +')')

FETCHNEXTFROM spID_Cursor

INTO @.spID

END

-- Close and deallocate the cursor

CLOSE spID_Cursor

DEALLOCATE spID_Cursor

|||thx more than I expected