SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS 101: Object Variables, ResultSets, and Foreach Loop Containers


SSIS 101: Object Variables, ResultSets, and Foreach Loop Containers

Author
Message
Andy Leonard
Andy Leonard
SSCertifiable
SSCertifiable (7.5K reputation)SSCertifiable (7.5K reputation)SSCertifiable (7.5K reputation)SSCertifiable (7.5K reputation)SSCertifiable (7.5K reputation)SSCertifiable (7.5K reputation)SSCertifiable (7.5K reputation)SSCertifiable (7.5K reputation)

Group: General Forum Members
Points: 7547 Visits: 1127
Comments posted to this topic are about the item SSIS 101: Object Variables, ResultSets, and Foreach Loop Containers

Andy Leonard, Chief Data Engineer, Enterprise Data & Analytics
Jack Corbett
  Jack Corbett
SSC Guru
SSC Guru (155K reputation)SSC Guru (155K reputation)SSC Guru (155K reputation)SSC Guru (155K reputation)SSC Guru (155K reputation)SSC Guru (155K reputation)SSC Guru (155K reputation)SSC Guru (155K reputation)

Group: General Forum Members
Points: 155888 Visits: 15115
Good article Andy. Wish I'd had it a month ago when I was first trying to figure out how to use Execute SQL Task with a result set. Took me probably an hour of searching and experimenting. This article makes it clear. The biggest issue I had was that I had no clue that ResultName was supposed to be the ordinal position of the result set returned by the SQL Statement. I started out by entering and actual name in here, and why not? It does say ResultName. Why not call it what it is, Result Set Ordinal? After some searching and pulling out some hair, I finally found this out. Your article would have been a big help.



Jack Corbett
Consultant Straight Path Solutions
Dont let the good be the enemy of the best. -- Paul Fleming
At best you can say that one job may be more secure than another, but total job security is an illusion. -- Rod at work
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a QuestionHow to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Anipaul
Anipaul
SSC-Insane
SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)

Group: General Forum Members
Points: 20201 Visits: 1407
Nice Article...



SATISD9X
SATISD9X
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1160 Visits: 212
Very nice article.

Infact the one about ADO.Net ConnectionType is also great.

Will this still work throughout all other RDMBS. e.g. ORACLE, SYBASE etc?

-Satish
Don Staten
Don Staten
SSChasing Mays
SSChasing Mays (617 reputation)SSChasing Mays (617 reputation)SSChasing Mays (617 reputation)SSChasing Mays (617 reputation)SSChasing Mays (617 reputation)SSChasing Mays (617 reputation)SSChasing Mays (617 reputation)SSChasing Mays (617 reputation)

Group: General Forum Members
Points: 617 Visits: 50
Thanks, Andy, for taking the time to put this article together. Sure was great to get a hands-on demo from you yesterday... then seeing the article today. How timely Wink

This one is definitely getting bookmarked!
Thomas LeBlanc
Thomas LeBlanc
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6695 Visits: 951
Great article, thanks... you should do more on SSIS

Thomas

Thomas LeBlanc, MVP Data Platform Consultant
Russel Bell
Russel Bell
SSC Veteran
SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)

Group: General Forum Members
Points: 263 Visits: 264
Thanks for the excellent treatment of a very common task that is not intuitive in SSIS. It seems relatively straightforward once you point out the ability to retrieve the resultset into an object variable, the kind of enumerator to use, and how to parse it out into variables. Tongue
todd_dawson
todd_dawson
SSC Eights!
SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)

Group: General Forum Members
Points: 928 Visits: 224
I keep getting a compile error on the VB.NET script saying that a declaration was expected on the 'PublicSub','sMsg','MsgBox' and 'Dts'.

The 'End Sub' is telling me it must be preceded by a matching 'Sub'.

I know nothing about the syntax from VB.NET but all I did was copy and paste your code over the code that was already there. Replacing the exsisting 'Main' function.

Holding my mouse over the SQL execute task in BIDS tells me that the task is configured to pre-compile the script, but no binary code is found. Please visit the IDE....

You need to correct your code and place a space in your 'Main' function to equal:

Public Sub Main()



This will help save some confusion for some of us non-code junkies. Smile

Otherwise, very nice article.
Andy Leonard
Andy Leonard
SSCertifiable
SSCertifiable (7.5K reputation)SSCertifiable (7.5K reputation)SSCertifiable (7.5K reputation)SSCertifiable (7.5K reputation)SSCertifiable (7.5K reputation)SSCertifiable (7.5K reputation)SSCertifiable (7.5K reputation)SSCertifiable (7.5K reputation)

Group: General Forum Members
Points: 7547 Visits: 1127
Thanks for all the kind words! There will be more SSIS articles from me.

Todd, sorry you had trouble with the typo but I'm glad you found it and fixed it - and I really appreciate that you posted the fix!

:{> Andy

Andy Leonard, Chief Data Engineer, Enterprise Data & Analytics
Paul Williams
Paul Williams
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1673 Visits: 882
Hi Andy,

In the article it states "The Full result set option returns an ADO.Net dataset object.....".
According to BOL :
"If the task uses a native connection manager, including the ADO, OLE DB, Excel, and ODBC connection managers, the returned object is an ADO Recordset.
If the task uses a managed connection manager, such as the ADO.NET connection manager, then the returned object is a System.Data.DataSet."

Thus, as an OLE DB connection is being used in the SQL Task, is a ADO Recordset object being returned rather than an ADO.net dataset which you allude to later in the article ?

Paul R Williams.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search