October 4, 2012 at 2:03 am
Hi,
Is there any T-SQL script or stored procedure that will list all the jobs associated with a database,instead of checking manually ??
I really appreciate all of you for attempting to help me out.
October 4, 2012 at 2:07 am
The only thing really would be to check the steps.
You could query msdb.dbo.sysjobsteps, but that will only tell you the DB which is in the step screen, it wont tell you if the T-SQL SSIS package etc cross over multiple DB's.
October 4, 2012 at 2:23 am
exec msdb.dbo.sp_help_jobstep @job_id = @job_id
command column gives you and subsystem must be t-sql
October 4, 2012 at 3:47 am
If you just need to know the name of the jobs, use the query below (replace name_of_your_database):
SELECT js.job_id,
name
FROM msdb.dbo.sysjobsteps js
INNER JOIN msdb.dbo.sysjobs_view jv
ON js.job_id = jv.job_id
WHERE database_name = <name_of_your_database>
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
October 4, 2012 at 11:34 pm
Hi,
Thanks for the reply.
This is what i was searching for.Thanks a lot.:-D
October 4, 2012 at 11:39 pm
Abhilash_A (10/4/2012)
Hi,Thanks for the reply.
This is what i was searching for.Thanks a lot.:-D
You are welcome Abhilash 🙂
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply