General information
Forum:
Microsoft SQL Server
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only