| Author |
Topic |
|
dejjan
Yak Posting Veteran
99 Posts |
Posted - 2005-05-24 : 05:53:08
|
| Hello.How could I find which job is currently active (using TSQL). I have one job and I want to know if that job is alredy active or not. |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-05-24 : 05:54:55
|
| select [name] from msdb..sysjobswhere enabled=1--------------------keeping it simple... |
 |
|
|
dejjan
Yak Posting Veteran
99 Posts |
Posted - 2005-05-24 : 06:19:20
|
| I don't need information if job is enabled or not. I need information if job is currently running. |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-05-24 : 06:27:17
|
quote: Originally posted by dejjan I don't need information if job is enabled or not. I need information if job is currently running.
ok, you didn't mention that, you just asked if it's active or notquery through sysprocesses then --------------------keeping it simple... |
 |
|
|
dejjan
Yak Posting Veteran
99 Posts |
Posted - 2005-05-24 : 06:48:56
|
| OK, I see my job in sysprocesses while it is running, but how to identify my process among all others. Maybe I could use value in column program_name: 'SQLAgent - TSQL JobStep (Job 0x9B32607C9E387A419F7209ED92730BF6 : Step 2))''. But I don't know to associate it with my job_id. |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-05-24 : 06:55:34
|
| the number you're seeing is the job id, you can then join it with sysjobs to get the name of the job--------------------keeping it simple... |
 |
|
|
dejjan
Yak Posting Veteran
99 Posts |
Posted - 2005-05-24 : 07:09:37
|
| but my job_id is '7C60329B-389E-417A-9F72-09ED92730BF6'I see some connection between job_id and '0x9B32607C9E387A419F7209ED92730BF6'. Does it exists some function, or smth else, which transform '0x9B32607C9E387A419F7209ED92730BF6' to '7C60329B-389E-417A-9F72-09ED92730BF6' |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
|
|
dejjan
Yak Posting Veteran
99 Posts |
Posted - 2005-05-25 : 04:08:56
|
| thanks, I find solution |
 |
|
|
|