Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Decrypting program name from sysprocesses for agent job Expand / Collapse
Author
Message
Posted Thursday, June 12, 2008 12:41 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, June 11, 2013 8:30 AM
Points: 1,106, Visits: 1,792
Hey all,

Are there any known ways to decrypt the hex shown in sysprocesses on program name when the process is a sql agent job?

For example, I have a job running now and it shows up as: SQLAgent - TSQL JobStep (Job 0x3E31DB24ED72CD49A8114462A66A0367 : Step 1). I want to display the actual job name in place of the hex. Using fn_hex_to_char works:
SELECT
name
,job_id
,'0x' + dbo.fn_hex_to_char(job_id,16)
FROM msdb.dbo.sysjobs

... but I'd prefer to have a function that actually replaced the passed in hex with the appropriate char value.

Thanks


--
Post #516187
Posted Friday, June 13, 2008 8:02 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, June 11, 2013 8:30 AM
Points: 1,106, Visits: 1,792
Anyone?

--
Post #516727
Posted Friday, June 13, 2008 10:53 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, September 11, 2012 5:12 PM
Points: 18, Visits: 35
The hex is the job_id for the job. You can query sysjobs and it will give you the name of the job.

e.g.
select * from msdb..sysjobs
where job_id = 0x1292021D3C929A4CBBE3895A61FA68CC



Post #516896
Posted Friday, June 13, 2008 11:07 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, June 11, 2013 8:30 AM
Points: 1,106, Visits: 1,792
akshay1974 (6/13/2008)
The hex is the job_id for the job. You can query sysjobs and it will give you the name of the job.

e.g.
select * from msdb..sysjobs
where job_id = 0x1292021D3C929A4CBBE3895A61FA68CC


Negative, the program_name from sysprocesses does not match up to the job_id from sysjobs.

For example, I'm showing SQLAgent - TSQL JobStep (Job 0x3E31DB24ED72CD49A8114462A66A0367 : Step 1) in sysprocesses, yet the job_id for this job is 24DB313E-72ED-49CD-A811-4462A66A0367.


--
Post #516910
Posted Friday, June 13, 2008 11:23 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, June 06, 2013 9:12 AM
Points: 6,260, Visits: 1,980
Adam Bean (6/13/2008)
akshay1974 (6/13/2008)
The hex is the job_id for the job. You can query sysjobs and it will give you the name of the job.

e.g.
select * from msdb..sysjobs
where job_id = 0x1292021D3C929A4CBBE3895A61FA68CC


Negative, the program_name from sysprocesses does not match up to the job_id from sysjobs.

For example, I'm showing SQLAgent - TSQL JobStep (Job 0x3E31DB24ED72CD49A8114462A66A0367 : Step 1) in sysprocesses, yet the job_id for this job is 24DB313E-72ED-49CD-A811-4462A66A0367.



select j.name
from msdb.dbo.sysjobs j
inner join
msdb.dbo.sysjobsteps s on j.job_id = s.job_id
where step_uid = '3E31DB24ED72CD49A8114462A66A0367' --job step id





* Noel
Post #516919
Posted Friday, June 13, 2008 11:25 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, June 11, 2013 8:30 AM
Points: 1,106, Visits: 1,792
Not the same number there either.

step_uid = 55060C17-0964-459C-A338-9ADF1C40384F
sysprocesses program_name = 0x3E31DB24ED72CD49A8114462A66A0367


--
Post #516921
Posted Friday, June 13, 2008 11:38 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, June 06, 2013 9:12 AM
Points: 6,260, Visits: 1,980
From your Post:

For example, I'm showing SQLAgent - TSQL JobStep (Job 0x3E31DB24ED72CD49A8114462A66A0367 : Step 1) in sysprocesses, yet the job_id for this job is 24DB313E-72ED-49CD-A811-4462A66A0367.


IF you replace 0x3E31DB24ED72CD49A8114462A66A0367 in the query I posted
for '3E31DB24ED72CD49A8114462A66A0367'

it will show the running jobname
--- Note: NO 0x, single-quoted AND NO "-".



* Noel
Post #516928
Posted Friday, June 13, 2008 11:54 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, June 11, 2013 8:30 AM
Points: 1,106, Visits: 1,792
Not sure If I'm following you here ...

sysjobs:
- job_id = 24DB313E-72ED-49CD-A811-4462A66A0367

sysjobsteps:
- step_uid = 55060C17-0964-459C-A338-9ADF1C40384F

sysprocesses:
- program_name = 0x3E31DB24ED72CD49A8114462A66A0367

How can I get that program_name to match up to the job or the jobstep? The number does not match ... regardless to as of the prefix 0x. The program_name and job_id are similar towards the end, but that's about it.


--
Post #516934
Posted Friday, June 13, 2008 12:36 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, September 11, 2012 5:12 PM
Points: 18, Visits: 35
The hex is the job_id. Try the below

select * from msdb..sysjobs where job_id =
0x3E31DB24ED72CD49A8114462A66A0367





Post #516962
Posted Friday, June 13, 2008 12:38 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, June 11, 2013 8:30 AM
Points: 1,106, Visits: 1,792
akshay1974 (6/13/2008)
The hex is the job_id. Try the below

select * from msdb..sysjobs where job_id =
0x3E31DB24ED72CD49A8114462A66A0367




Woah, how is this possible? How can I convert that number to match the job_id?


--
Post #516964
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse