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
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

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

Andy Leonard
Data Philosopher, Enterprise Data & Analytics
Jack Corbett
  Jack Corbett
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45199 Visits: 14925
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

Applications Developer

Don't 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 Question
How 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
SSCrazy Eights
SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)

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



SATISD9X
SATISD9X
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1044 Visits: 180
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
SSC-Enthusiastic
SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)

Group: General Forum Members
Points: 183 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
SSCarpal Tunnel
SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)

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

Thomas

Thomas LeBlanc, MCITP DBA 2005, 2008 & MCDBA 2000
http://thesmilingdba.blogspot.com/
Russel Bell
Russel Bell
SSC-Enthusiastic
SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)

Group: General Forum Members
Points: 101 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 Veteran
SSC Veteran (282 reputation)SSC Veteran (282 reputation)SSC Veteran (282 reputation)SSC Veteran (282 reputation)SSC Veteran (282 reputation)SSC Veteran (282 reputation)SSC Veteran (282 reputation)SSC Veteran (282 reputation)

Group: General Forum Members
Points: 282 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
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2377 Visits: 1101
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
Data Philosopher, Enterprise Data & Analytics
Paul Williams
Paul Williams
SSC Eights!
SSC Eights! (805 reputation)SSC Eights! (805 reputation)SSC Eights! (805 reputation)SSC Eights! (805 reputation)SSC Eights! (805 reputation)SSC Eights! (805 reputation)SSC Eights! (805 reputation)SSC Eights! (805 reputation)

Group: General Forum Members
Points: 805 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