Home All Groups Group Topic Archive Search About

sysprocesses vs job

Author
3 Feb 2006 7:33 PM
Lynn
Hi,

Is there any way to identify job in master..sysprocesses table?  Thank you.

Also, it happens all the time -- I cancelled the job, but the job processes
id keep stay active all the time.  Issue KILL statement, but the processes
still stay runnable all the time until restart the SQL server?  Any idea for
this issue.
--
Best Regards,

Lynn

Author
3 Feb 2006 10:41 PM
Erland Sommarskog
Lynn (L***@discussions.microsoft.com) writes:
> Is there any way to identify job in master..sysprocesses table?  Thank
> you.
>
> Also, it happens all the time -- I cancelled the job, but the job
> processes id keep stay active all the time.  Issue KILL statement, but
> the processes still stay runnable all the time until restart the SQL
> server?  Any idea for this issue.

What state is it in? If process was in a transaction, it can take a
long time to rollback.



--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Author
4 Feb 2006 8:08 PM
John T
At least with sql2k sp4, if you select * from sysprocesses, the column
program_name will contain an entry like SQLAgent - TSQL JobStep (Job
0x3459258D70D52A41B2D24B37B1FD2822 : Step 1).  The GUID in this line can then
be cross referenced to msdb..sysjobs job_id.  Also, if you know the TSQL the
job is running, the sql_handle in sysprocesses can tell you what sql batch or
statement is currently running as well.

Show quote
"Lynn" wrote:

> Hi,
>
> Is there any way to identify job in master..sysprocesses table?  Thank you.
>
> Also, it happens all the time -- I cancelled the job, but the job processes
> id keep stay active all the time.  Issue KILL statement, but the processes
> still stay runnable all the time until restart the SQL server?  Any idea for
> this issue.
> --
> Best Regards,
>
> Lynn
Author
4 Feb 2006 9:00 PM
Lynn
John,

Thank you.  Yes. it's did cross reference with the job_id for the last two
segments without '-'.  (I compareed the begin of string before and it didn't
work :)

You mentioned sql_handle, they all looks like the codeing for me, such as
0x0100120044C7142BC0A0F8490000000000000000.  How can I read those binary
file?  Thank you again.

Also, it happens all the time -- I cancelled the job, but the job processes
id keep stay active all the time.  Issue KILL statement, but the processes
still stay runnable all the time until restart the SQL server?  Any idea for
this issue.

thank you again
--
Best Regards,

Lynn


Show quote
"John T" wrote:

> At least with sql2k sp4, if you select * from sysprocesses, the column
> program_name will contain an entry like SQLAgent - TSQL JobStep (Job
> 0x3459258D70D52A41B2D24B37B1FD2822 : Step 1).  The GUID in this line can then
> be cross referenced to msdb..sysjobs job_id.  Also, if you know the TSQL the
> job is running, the sql_handle in sysprocesses can tell you what sql batch or
> statement is currently running as well.
>
> "Lynn" wrote:
>
> > Hi,
> >
> > Is there any way to identify job in master..sysprocesses table?  Thank you.
> >
> > Also, it happens all the time -- I cancelled the job, but the job processes
> > id keep stay active all the time.  Issue KILL statement, but the processes
> > still stay runnable all the time until restart the SQL server?  Any idea for
> > this issue.
> > --
> > Best Regards,
> >
> > Lynn
Author
4 Feb 2006 11:57 PM
Erland Sommarskog
Lynn (L***@discussions.microsoft.com) writes:
> You mentioned sql_handle, they all looks like the codeing for me, such as
> 0x0100120044C7142BC0A0F8490000000000000000.  How can I read those binary
> file?  Thank you again.

You can use fn_get_sql to get the actual statement. Since I'm too lazy
to look up the code, I just point you do my procedure aba_lockinfo
that will do that work for you. It's at
http://www.sommarskog.se/sqlutil/aba_lockinfo.html.



--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

AddThis Social Bookmark Button