October 1, 2012 at 10:09 am
Hello - I'm using SQL Server 2008 Standard.
What is the T-SQL to use to find out which databaes a job is attached to?
If I click "Edit" in the "Job step list", I can see the Database in teh drop down. Where is that stored? I don't see it in sysjobs.
I'd like to be able to see if any jobs are attached to a database before taking it offline.
Thanks
Dave
October 1, 2012 at 10:19 am
That info is in sysjobsteps
October 1, 2012 at 11:59 am
Thank you - your reply enabled me to put a query together for active jobs
-- How to find the name and database of enabled jobs
select [name], database_name
from sysjobs sj
join sysjobsteps so
on sj.job_id=so.job_id
where [enabled]=1
October 1, 2012 at 12:40 pm
Your welcome Dave!
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply