Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Execute job
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Divers
Thread ID:
00847105
Message ID:
00848392
Vues:
24
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform