Solved

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

Posted on 2007-11-25
3
1,231 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Suggested Solutions

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

706 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

18 Experts available now in Live!

Get 1:1 Help Now