SSIS - 如何使用执行 SQL 任务的结果来调用 Web 服务

SSIS - How to use results of Execute SQL Task to call a Web Service

我需要使用 SQL SELECT 的结果,它应该 return 一个 ID 数组以在我的 foreach 循环中迭代它。 我对 SSIS 很陌生。我创建了执行 SQL 任务,连接到数据库并写入

SELECT ID FROM TABLE

然后我创建了Script Task,并用Constraint连接了这两个组件。但我不知道如何将 SQL Task 的结果传递到 Script Task 中的对象。

您正在寻找的典型模式是这样的:

1. In execute SQL you need to:
a. Assign the connection
b. Add your SQL Statement
c. Change Result Set to Full Result Set
d. Map the result set to an Object type variable

2. In Foreach
a. Change enumerator to ADO Enum
b. Assign your variable from #1
c. Map a variable to the interation

****EDIT****
3. Change out data flow for script task
a. Pass in iteration variable
b. in script create the URL as a string
c. use webclient to connect to web service


string url = @"https://www.blah.com? ID=" + 
             Dts.Variable["variable"].Value.ToString();

WebClient wc = new WebClient();
string result = wc.DownloadString(url);

4. Now you have to do something with that result