问题描述
我正在从如下所示的存储过程调用 SQL Server 作业
I am calling a SQL Server job from a stored procedure like below
CREATE PROC StartMyMonthlyInventoryJob
AS
EXEC msdb.dbo.sp_start_job N'_TIME_ACCESSABILITY_HOURS'
GO
并且我想更改此作业的设置值(我知道如何以图形方式进行配置).当我从存储过程调用该作业时,如何传递参数以设置值?谢谢
and I want to change the set values for this job (I know how to configure in graphical way). How do I pass parameters to set value when I call that job from a stored procedure? Thanks
推荐答案
你没有.
相反,您创建一个表,其中包含作业将传递给 SSIS 包的所有参数.
Instead you create a table that holds all the parameters that the job would pass to the SSIS package.
向包添加新的第一步,从表中读取参数并填充包变量.
Add a new first step to the package to read the parameters from the table and populate the package variables.
向包添加一个新的最后一步以更新参数表并删除该行,或使用某种已完成"标志更新它.
Add a new last step to the package to update the parameters-table and either delete the row, or update it with a "completed" flag of some kind.
这篇关于如何从存储过程传递参数以在 SQL Server 代理作业中设置值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!