foreach 루프에서 반복하기 위해 ID 배열을 반환해야하는 SQL SELECT의 결과를 사용해야합니다. 저는 SSIS를 처음 사용합니다. SQL 실행 작업을 생성하고 DB에 연결하여 작성했습니다.
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
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다