Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 job id not the same?

Author  Topic 

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-10-21 : 03:09:01
data:
from sysjobs...
E196AEF3-FC12-4A1A-9FBF-A0E328E19740

from sysprocesses...
...................9FBFA0E328E19740

questions:
1. does anyone here have an idea why the job id in sysprocess is not the same as the one in sysjobs? they only have the last 2 sets of numbers equal.

2. what are the first 3 sets of numbers for?

i'm trying to determine if the job has completed before issuing another job...

thanks in advance...

--------------------
keeping it simple...

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2004-10-21 : 04:01:30
The other two sets seem to be reversed..
sysjobs...
job_id
------------------------------------
AAC17DBA-838F-43DA-8735-BCCD9BDDD98C
sysprocesses...(formatted)
BA7DC1AA-8F83-DA43-8735-BCCD9BDDD98C


How about:
create table #xp_results(
job_id uniqueidentifier not null,
last_run_date int not null,
last_run_time int not null,
next_run_date int not null,
next_run_time int not null,
next_run_schedule_id int not null,
requested_to_run int not null, -- bool
request_source int not null,
request_source_id sysname collate database_default null,
running int not null, -- bool
current_step int not null,
current_retry_attempt int not null,
job_state int not null )

insert #xp_results exec master.dbo.xp_sqlagent_enum_jobs @is_sysadmin = 1, @job_owner = ''

select job_id as running_jobs from #xp_results where running = 1


rockmoose
/* Chaos is the nature of things...Order is a lesser state of chaos */
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-10-21 : 05:00:30
wow, that was great, thanks rockmoose...

i really need to explore extended sp's

--------------------
keeping it simple...
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-10-21 : 05:46:21
hey it's undocumented!

, anyone with a list of undocumented xp's? i'm sure needing them a lot this days...

--------------------
keeping it simple...
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2004-10-21 : 06:42:57
Hi Jen,

If you google for undocumented stored procedures I am sure you will find lot's of references.
I have seen a few sites where people have compilations of those...
( Have no link for you now though )

Actually that could be a good reference / FAQ / link on this site.

If you post a new thread asking for undocumented procs,
you will get interesting links I am sure.

/rockmoose
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-10-21 : 06:49:43
ha ha ha, you got me there, but i trust sqlteam, that they have tested and probably have used them before posting...

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -