• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1241
  • Last Modified:

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

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
StanleyLMW
Asked:
StanleyLMW
  • 2
1 Solution
 
Ken SelviaRetiredCommented:
Try

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

0
 
Ken SelviaRetiredCommented:
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
 
StanleyLMWAuthor Commented:
Thanks a lot.  It works.  Cheers!  ^_^
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now