在SSIS包中,我正在执行返回2行( select PathName, FolderPath from config )的存储过程usp_GetResult。
PathName : InboundFolderPath
FolderPath : c:\Inbound
PathName : OutboundFolderPath
FolderPath : c:\Outbound我将不得不映射变量@InboundFolderPath = c:\Inbound、@OutboundFolderPath = c:\Outbound
如何将存储过程的输出映射到SQL任务中的变量?
发布于 2019-01-08 04:05:05
我知道的唯一方法是在执行SQL任务中使用“完整结果集”,并将结果存储在对象变量中。
然后使用脚本任务将对象变量转换为数据集,并对其进行迭代以填充标量变量。
发布于 2019-01-08 05:35:58
我还没有真正尝试过,但是这样如何:
Declare @T Table (pathName varchar(100), folderName varchar(100))
Insert @T Exec StoredProc params
Select max(case when PathName = 'InboundFolderPath' then folderName end ) inBound
,max(case when PathName = 'OutboundFolderPath' then folderName end ) outBound
from @T然后映射
https://stackoverflow.com/questions/54080920
复制相似问题