Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

SSIS 101: Object Variables, ResultSets, and Foreach Loop Containers Expand / Collapse
Author
Message
Posted Wednesday, August 20, 2008 11:01 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 12:44 PM
Points: 389, Visits: 1,041
Comments posted to this topic are about the item SSIS 101: Object Variables, ResultSets, and Foreach Loop Containers

Andy Leonard
CSO, Linchpin People
Follow me on Twitter: @AndyLeonard
Post #556277
Posted Thursday, August 21, 2008 12:57 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 1:22 PM
Points: 11,148, Visits: 12,889
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

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
Post #556308
Posted Thursday, August 21, 2008 4:13 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, July 17, 2014 10:36 PM
Points: 5,299, Visits: 1,378
Nice Article...


Post #556385
Posted Thursday, August 21, 2008 4:28 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, April 21, 2014 3:27 PM
Points: 1,011, Visits: 172
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
Post #556389
Posted Thursday, August 21, 2008 6:18 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, August 27, 2012 11:42 AM
Points: 65, 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 ;)

This one is definitely getting bookmarked!
Post #556449
Posted Thursday, August 21, 2008 7:24 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Saturday, July 19, 2014 5:57 AM
Points: 3,049, Visits: 779
Great article, thanks... you should do more on SSIS

Thomas


Thomas LeBlanc, MCITP DBA 2005, 2008 & MCDBA 2000
http://thesmilingdba.blogspot.com/
Post #556548
Posted Thursday, August 21, 2008 8:29 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, January 21, 2013 8:42 AM
Points: 13, 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. :P
Post #556621
Posted Friday, August 22, 2008 6:45 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, November 6, 2008 6:21 PM
Points: 52, 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. :)

Otherwise, very nice article.
Post #557298
Posted Saturday, August 23, 2008 7:01 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 12:44 PM
Points: 389, Visits: 1,041
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
CSO, Linchpin People
Follow me on Twitter: @AndyLeonard
Post #557754
Posted Friday, August 29, 2008 2:22 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: 2 days ago @ 4:55 AM
Points: 536, Visits: 703
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.
Post #561041
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse