To retrieve the rowset data stored in a global variable using the Execute SQL task
Function Main()
statement, type the following Microsoft Visual Basic® Scripting Edition (VBScript) code:
dim countr
dim RS
set RS = CreateObject("ADODB.Recordset")
set RS = DTSGlobalVariables("Authors").value
for countr = 1 to RS.RecordCount
MsgBox "The author ID is " & RS.Fields("au_id").value
RS.MoveNext
Next
Main = DTSTaskExecResult_Success
The au_id column for each row returned from the SELECT statement is displayed.