Solved

List all SQL Schedule job in SQL Server

Posted on 2014-12-02
7
117 Views
Last Modified: 2014-12-07
How to list all all schedule SQL Jobs that called  up a particular stored procedure or update a table in SQL Server 2008R2 ?

Tks
0
Comment
Question by:AXISHK
  • 3
  • 2
  • 2
7 Comments
 
LVL 7

Expert Comment

by:Phil Davidson
ID: 40477895
Try
 exec sp_help_job where @job_name = 'nameOfJobHere' 

Open in new window


Variations of sp_help_job may work for you.

Can you clarify that you want to list the SQL Jobs that invoke a given stored procedure?  I'm not sure about the "update a  table" portion of your request.  Do you want to know the tables that a given stored procedure updates too?

What do you know about the stored procedures? (e.g., name only?)
0
 

Author Comment

by:AXISHK
ID: 40477936
The SQL schedule job will can either schedule a SQL proc or put a statement on it. How can I list the SQL procedure that contain the name of SQL proc or table.  Tks
0
 
LVL 46

Expert Comment

by:Vitor Montalvão
ID: 40478126
The sp_help_job will give you the command used by the job, so you can use Phil's solution for that.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:AXISHK
ID: 40480046
exec sp_help_job where @job_name = 'AutoFormData'

Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'where'.


Any idea ??
0
 
LVL 7

Assisted Solution

by:Phil Davidson
Phil Davidson earned 200 total points
ID: 40480125
Sorry, I made a small mistake. Try this:

USE msdb ;
GO
EXEC sp_help_job 
@job_name = 'AutoFormData' ;
GO

Open in new window

0
 

Author Comment

by:AXISHK
ID: 40480347
The query need to specify the SQL Job Name. But in case I have a table (or a name of the procedure) but I want to know which SQL job has referred to it. How can I do this ?

Tks
0
 
LVL 46

Accepted Solution

by:
Vitor Montalvão earned 300 total points
ID: 40480506
For that you need to query sysjobssteps:
USE msdb
GO

SELECT j.name
FROM sysjobsteps s
	INNER JOIN sysjobs j ON j.job_id=s.job_id
WHERE s.command LIKE '%TableName%'

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now