We have created a SQL Server Job called 'Asynchronous Batch Agent'
which is run Asynchronously on a set of databases each containing a
batch.
What I would like to do is to retrieve the Process ID of a particular
instance of this agent when its being called and write that to a table
with the ID for the individual database.
Im having little luck at finding this information. I look at sp_who2
and sysprocesses...but get a link to the job.
Thanks for your help on this
ChrisHi Chris,
Try @.@.spid, db_id() and db_name().
Hope this helps,
Ben Nevarez
"chris.asaipillai@.gmail.com" wrote:
> We have created a SQL Server Job called 'Asynchronous Batch Agent'
> which is run Asynchronously on a set of databases each containing a
> batch.
> What I would like to do is to retrieve the Process ID of a particular
> instance of this agent when its being called and write that to a table
> with the ID for the individual database.
> Im having little luck at finding this information. I look at sp_who2
> and sysprocesses...but get a link to the job.
> Thanks for your help on this
> Chris
>
Monday, March 26, 2012
Retriveing the process ID for a SQL Server Agent job being run
Labels:
agent,
asynchronous,
asynchronously,
batch,
containing,
created,
database,
databases,
job,
microsoft,
mysql,
oracle,
process,
retriveing,
run,
server,
sql
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment