Solved

List all SQL Schedule job in SQL Server

Posted on 2014-12-02
7
114 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 45

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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 45

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 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

12 Experts available now in Live!

Get 1:1 Help Now