Friday, June 22, 2012

Job Name from sp_who2 ProgramName Column

To verify the active processes we all use a command called sp_who2, It gives information about the processes that are running on the instance.

In the output there is a column called programName using which we can identify what program is invoked the process. If SQL Server Agent is invoked any job then this column is filled like below.

SQLAgent - TSQL JobStep (Job 0x63F686011DDC76FAA8593A541343A1A7E : Step 2)

Below command helps to identify the job name based on the above job step value

select * from msdb..sysjobs where
job_id = convert(uniqueidentifier,0x63F686011DDC76FAA8593A541343A1A7E)

No comments: