Home > Archive > MS SQL Server DTS > June 2005 > Changing the DataSource in a loop









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Changing the DataSource in a loop
JvCoach23

2005-06-30, 9:23 am

I'm trying to change the datasource for a dts package inside of a loop.
I've created a dyanmic proprety that is housed inside the looping steps
that has the datasource = value of a global variable. In the workflow
active x for the dynamic properties i add a
msgbox(DTSGlobalVari
ables("CurrentDSN").Value). This value changes
each time through the loop correctly, but the datasource seems not to
change. I am checking this by doing a step right after the dynamic
that does a count. The count for the first value assigned is 335, the
second time through hitting the second data source value should be 901,
but it is 335. I am not sure what i'm doing wrong that the value
doesn't stick.

Please help
thanks
shannon

Shannon Ramirez

2005-06-30, 11:23 am

I'n not 100 % positive yet.. but I think I got it figured out. Found a
nugget of info on www.deja.com. Mr. Allan Mitchell mentioned to someone
else that in the workflow properties you need to tell the connection to
close on completion. I did that and now it's able to give it a new
datasource.. that makes sense..



Anyway.. thanks

Shannon




> I'm trying to change the datasource for a dts package inside of a loop.
> I've created a dyanmic proprety that is housed inside the looping steps
> that has the datasource = value of a global variable. In the workflow
> active x for the dynamic properties i add a
> msgbox(DTSGlobalVari
ables("CurrentDSN").Value). This value changes
> each time through the loop correctly, but the datasource seems not to
> change. I am checking this by doing a step right after the dynamic
> that does a count. The count for the first value assigned is 335, the
> second time through hitting the second data source value should be 901,
> but it is 335. I am not sure what i'm doing wrong that the value
> doesn't stick.
>
> Please help
> thanks
> shannon
>



Allan Mitchell

2005-06-30, 8:23 pm

Chance are you are not closing the connection in the workflow properties
each time

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"JvCoach23" <jvcoach23@hotmail.com> wrote in message
news:1120138657.415629.304620@g43g2000cwa.googlegroups.com...
> I'm trying to change the datasource for a dts package inside of a loop.
> I've created a dyanmic proprety that is housed inside the looping steps
> that has the datasource = value of a global variable. In the workflow
> active x for the dynamic properties i add a
> msgbox(DTSGlobalVari
ables("CurrentDSN").Value). This value changes
> each time through the loop correctly, but the datasource seems not to
> change. I am checking this by doing a step right after the dynamic
> that does a count. The count for the first value assigned is 335, the
> second time through hitting the second data source value should be 901,
> but it is 335. I am not sure what i'm doing wrong that the value
> doesn't stick.
>
> Please help
> thanks
> shannon
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com