How do we know if a process is user process or system process

How do we know if a process is user process or system process

Post by Ravi » Fri, 17 May 2002 19:38:37



Hi,
I have SqlServer 2000. I need to detach a database and for
this i am making sure to kill the connections to that
database. I am doing this after removing the replication
setup on this database. When i try to kill connections i
am having a cursor for the following sp id's and looping
through each of this pid and calling kill pid
ex:  
  Select spid, dbid from master..sysprocesses

this procedure of kill i call being in a different
database.

Now sometimes i get an error that Only user processes can
be killed when i run my kill procedure.

How do i make sure to kill only user processes on the
database and if some system process is accessing my
database i do i manage to detach my database.
Also is there any flag to check if it is a user or system
process in the sysprocesses

Regards,
Ravi

 
 
 

How do we know if a process is user process or system process

Post by Dejan Sark » Fri, 17 May 2002 19:46:42


Hi!

User processes have spid > 50 in SQL 2000.

--
Dejan Sarka, SQL Server MVP
FAQ from Neil & others at: http://www.sqlserverfaq.com
Please reply only to the newsgroups.
PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


> Hi,
> I have SqlServer 2000. I need to detach a database and for
> this i am making sure to kill the connections to that
> database. I am doing this after removing the replication
> setup on this database. When i try to kill connections i
> am having a cursor for the following sp id's and looping
> through each of this pid and calling kill pid
> ex:
>   Select spid, dbid from master..sysprocesses

> this procedure of kill i call being in a different
> database.

> Now sometimes i get an error that Only user processes can
> be killed when i run my kill procedure.

> How do i make sure to kill only user processes on the
> database and if some system process is accessing my
> database i do i manage to detach my database.
> Also is there any flag to check if it is a user or system
> process in the sysprocesses

> Regards,
> Ravi


 
 
 

How do we know if a process is user process or system process

Post by Tibor Karasz » Fri, 17 May 2002 19:54:50


... and (FWIW) > 10 in 7.0... (as I recall it)

--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sql...


> Hi!

> User processes have spid > 50 in SQL 2000.

> --
> Dejan Sarka, SQL Server MVP
> FAQ from Neil & others at: http://www.sqlserverfaq.com
> Please reply only to the newsgroups.
> PASS - the definitive, global community
> for SQL Server professionals - http://www.sqlpass.org



> > Hi,
> > I have SqlServer 2000. I need to detach a database and for
> > this i am making sure to kill the connections to that
> > database. I am doing this after removing the replication
> > setup on this database. When i try to kill connections i
> > am having a cursor for the following sp id's and looping
> > through each of this pid and calling kill pid
> > ex:
> >   Select spid, dbid from master..sysprocesses

> > this procedure of kill i call being in a different
> > database.

> > Now sometimes i get an error that Only user processes can
> > be killed when i run my kill procedure.

> > How do i make sure to kill only user processes on the
> > database and if some system process is accessing my
> > database i do i manage to detach my database.
> > Also is there any flag to check if it is a user or system
> > process in the sysprocesses

> > Regards,
> > Ravi

 
 
 

How do we know if a process is user process or system process

Post by Min Su[M » Sun, 19 May 2002 07:43:29


Hello Ravi,

On SQL 7.0 spid> 6 are the user spid

Min Su

This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure?  For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.