Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2007-11-25
3
Medium Priority
?
1,236 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
kselvia earned 2000 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

670 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