Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
powellbound
Starting Member
23 Posts |
Posted - 2008-09-16 : 21:17:54
|
I have a table with about 15 rows in it.I can do a SQLTask to dump the select of the table into a object variable named cities. Now I want to roll through what would normally be an array and place the value for element 1 into another variable, url, which I will use to get an XML file from. Do some processing of the XML file and then go to element 2 and process next XML file. Repeat until all 15 rows in the table / cities variable have been used.I cannot seem to figure out how to reference the individual elements of the cities variable.Thanks in advance. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-16 : 23:52:07
|
didnt understand that. how would you store entire table contents into a single variable? there are no arrays in sql.However, you could bring all data as a comma seperated list in sql. is that what you're looking at? |
 |
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2008-09-17 : 01:32:45
|
What. The. Hale. Are. You. Doing?Use SSIS for transferring data into and out of the database. That's it.Do NOT put all this business logic into a crappy, overextended, virtually-guaranteed-not-to-be-backward-compatible-after-the-next-upgrade, impossible-to-debug, pimped-out utility like SSIS.Boycotted Beijing Olympics 2008 |
 |
|
powellbound
Starting Member
23 Posts |
Posted - 2008-09-17 : 09:47:06
|
My bad for not being clear. Probably frustrated by my lack of understanding.What I am trying to do is use the db to maintain a list of URLs that we repeatedly get XML data from. I access the list in a SQL task to load the object variable cities, which is really about 13-17 formatted XML URLs. I then want to roll thru the elements in the cities variable and pass each element, 1 by 1, to another package variable called url. From there, I would use the url var in a data flow task where we open an XML Source and then load that data.Basically, I am trying to loop thru a small table and for each value in the select, do something based on the value of the select.In my mind, it should be very straight forward but I cannot seem to get the data out of the cities object var to pass to the url var. Does this make more sense?Thanks for putting up with me.David |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-17 : 09:52:26
|
quote: Originally posted by powellbound My bad for not being clear. Probably frustrated by my lack of understanding.What I am trying to do is use the db to maintain a list of URLs that we repeatedly get XML data from. I access the list in a SQL task to load the object variable cities, which is really about 13-17 formatted XML URLs. I then want to roll thru the elements in the cities variable and pass each element, 1 by 1, to another package variable called url. From there, I would use the url var in a data flow task where we open an XML Source and then load that data.Basically, I am trying to loop thru a small table and for each value in the select, do something based on the value of the select.In my mind, it should be very straight forward but I cannot seem to get the data out of the cities object var to pass to the url var. Does this make more sense?Thanks for putting up with me.David
for blue part, use SQL Task and store result as recordsetfor green part, use a for each loop ADO enumerator and map the recordset to one created on previous step. |
 |
|
powellbound
Starting Member
23 Posts |
Posted - 2008-09-17 : 16:42:50
|
Perfect, that is exactly the advice I needed.Thanks so much! |
 |
|
|
|
|
|
|