SEEKING INFO ABOUT SQLAgent - TSQL Jobstep type program_names ...

Last post 05-19-2008, 12:45 PM by randyvol. 2 replies.
Sort Posts: Previous Next
  •  05-16-2008, 7:53 AM Post number 53114

    • randyvol is not online. Last active: 10-10-2008, 6:21 AM randyvol
    • Top 25 Contributor
    • Joined on 04-04-2007
    • Columbia, SC (USA)
    • Level 2: Deep Blue

    SEEKING INFO ABOUT SQLAgent - TSQL Jobstep type program_names ...

    I'm trying to ascertain how I can find out more about a particular job.

    The information I have from a script I have to identify deadlock root causes gave me back this information:

    spid 86 is blocking spid 51... spid 86 info:  SQLAgent - TSQL JobStep (Job 0xBAD836E3D331B44BA4CCAC400D244B17 : Step 1)

    Well, that's good to know, but I would like to be able to identify the particular job that 'owns' TSQL JobStep (Job 0xBAD836E3D331B44BA4CCAC400D244B17 : Step 1).

    I've read the BOL on the sysjob type tables; and, while they tell me about the columns in the tables and what they are, they tell me absolutely nothing about how to figure out what I want to know.

    I suspect one problem I have is that '0xBAD836E3D331B44BA4CCAC400D244B17' needs converting to something else and I have no idea how to go about doing this.  I was never that good at converting hex (I assume that is what this is) when I was doing it rather often, which is years ago, so I really have no idea how to start.

    Can anyone throw me a lifeline here?
    Tia

    randyvol

  •  05-19-2008, 6:14 AM Post number 53491 in reply to post number 53114

    Re: SEEKING INFO ABOUT SQLAgent - TSQL Jobstep type program_names ...

    This should do it:

    SELECT *
    FROM msdb.dbo.sysjobs
    WHERE job_id = CAST(0xBAD836E3D331B44BA4CCAC400D244B17  AS UNIQUEIDENTIFIER)

    Chris

  •  05-19-2008, 12:45 PM Post number 53606 in reply to post number 53491

    • randyvol is not online. Last active: 10-10-2008, 6:21 AM randyvol
    • Top 25 Contributor
    • Joined on 04-04-2007
    • Columbia, SC (USA)
    • Level 2: Deep Blue

    Re: SEEKING INFO ABOUT SQLAgent - TSQL Jobstep type program_names ...

    Why yes it did !

     

    Thanks so much, never occurred to me that it would be as simple to solve as using a CAST.

View as RSS news feed in XML