Solved

MS SQL 2000 : How to invoke/start a scheduled SQL job via stored procedure?

Posted on 2007-11-25
3
1,233 Views
Last Modified: 2010-04-21
Hi,

I have a scheduled job being created in SQL job scheduler (in Enterprise Manager, it is under Management->SQL server agent->Job).  This job (contains many many steps) needs to be run under schedule.  However, it also need to run under user request.

For the scheduled one, no problem.  But for the user request one, we really don't want to duplicate the same set into a stored procedure as this job has many dependences and will notify operator via  email.  As a result, put it again under stored procedure and to do the same will not be a good idea.  My question is : are there any ways to invoke/start the scheduled job manually via stored procedure ?  (I will make this command as a table trigger)

Thanks a lot.

Cheers
Stanley
0
Comment
Question by:StanleyLMW
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
kselvia earned 500 total points
ID: 20348587
Try

exec msdb..sp_start_job @job_name = 'Job Name'

0
 
LVL 12

Expert Comment

by:kselvia
ID: 20348593
Also, you might take a look at this

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_22965040.html

for more info about using that in a trigger.
0
 

Author Closing Comment

by:StanleyLMW
ID: 31410934
Thanks a lot.  It works.  Cheers!  ^_^
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

830 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