Automating SSIS package execution through SQL Server Agent jobs is a common requirement, but syntax errors can возникать when specifying package paths within the job step commands.
To execute an SSIS package in a SQL Server Agent job step, use the following syntax:
/FILE "<package_path>"
In the provided script, the syntax error occurs due to the use of '/FILE' without quotation marks. The correct syntax is:
EXEC sp_add_jobstep @job_id = @jobid ,@step_name = N'Upload Data' ,@step_id = 1 ,@command=N'/FILE "D:\Installs\Upload.dtsx"' EXEC sp_add_jobstep @job_id = @jobid ,@step_name = N'Download Data' ,@step_id = 2 ,@command=N'/FILE "D:\Installs\Download.dtsx"'
Alternatively, you can use the SQL Server Management Studio graphical user interface to create a job and add SSIS package execution steps:
The above is the detailed content of How to Correctly Execute SSIS Packages within SQL Server Agent Jobs?. For more information, please follow other related articles on the PHP Chinese website!