Monday, March 26, 2012

Killing a User Process

Hi All
Here is the scenario, a user has a query running which has
taken far too long and needs to be killed. This is a front
end and the user does not have access to SQL Server.
1. Can that user Kill the Process.
2. What wuld be the code to do that?
Many Thanks
PaulHi Paul,
1. Most likely not. To kill a SQL Server process you have to be a member of
the sysadmin or processadmin roles, and ordinary users usually aren't.
2. KILL <spid> where spid is the process is of the process.
Note that KILLing a process will cause all the transactions that have been
started by the process to be rolled back, so it can take some time before
the process is actually really killed.
--
Jacco Schalkwijk MCDBA, MCSD, MCSE
Database Administrator
Eurostop Ltd.
"paul Blackler" <pblackler@.themis.co.uk> wrote in message
news:06ae01c37081$75949630$a601280a@.phx.gbl...
> Hi All
> Here is the scenario, a user has a query running which has
> taken far too long and needs to be killed. This is a front
> end and the user does not have access to SQL Server.
> 1. Can that user Kill the Process.
> 2. What wuld be the code to do that?
> Many Thanks
> Paul

No comments:

Post a Comment