How to identify the job running through SQLServer Agent using SQL?

— List processes currently running through SQLServer Agent
select spid, program_name, blocked from master..sysprocesses where program_name like ‘SQLAgent%’

spid program_name blocked
—— ——————————————————————————— ——-
148 SQLAgent – TSQL JobStep (Job 0x6CDB1221B7584941B63E44C95E805E43 : Step 1) 0

— Using the Job from program_name in Step 1, find information on the job
select job_id, name, description from msdb..sysjobs where job_id = convert(uniqueidentifier, 0x6CDB1221B7584941B63E44C95E805E43)
job_id name description
———————————— ————————————- ————
2112DB6C-58B7-4149-B63E-44C95E805E43 purge transaction

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s