Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Execute job
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00847105
Message ID:
00848392
Views:
23
Hi All:
I want to execute my jobs from the stored procedure I created.
Here is my code

CREATE PROCEDURE [Update_Datawarehouse] AS

USE msdb
EXEC sp_start_job @job_name = 'TRUNCATE DATAWAREHOUSE TABLES'
EXEC sp_start_job @job_name = 'PROPHECY TO DATAWAREHOUSE IMPORT'

I get an error 154, which reads" a USE database statement is not allowed in a procedure or trigger."

Thus, my questions is how can I execute a job from stored procedure?
Thanks
MA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform