dbTalk Databases Forums  

Dynamic connections do not change in loops

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Dynamic connections do not change in loops in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim L
 
Posts: n/a

Default Dynamic connections do not change in loops - 02-06-2004 , 01:28 PM






This is the second package I have had this trouble with. The first time I
only resolved the problem by recreating the package from the beginning. This
time, recreating the package does not help.

Here is my problem...

I change the catalog of a SQL connection object via script, retrieve some
value then loop back, change the catalog to a different database, retrieve
some, value, etc.

- All the looping works as expected.
- When I execute the steps manually, all values are retrieved from the
correct databases as expected.
- When I run the whole package, the steps loop as expected, but the database
connection refuses to change and I get only the value from the first
database over and over.

- I use msgboxes to display the catalog value of the connection and it shows
the correct database, however, it still uses the wrong one.

It seems I need to force the connection to close so it actually connects to
the new database.
Any ideas?

Jim



Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: Dynamic connections do not change in loops - 02-06-2004 , 04:33 PM






In message <uwLIfdO7DHA.3024 (AT) tk2msftngp13 (DOT) phx.gbl>, Jim L
<jimL (AT) integrationgroup (DOT) remove.com> writes
Quote:
This is the second package I have had this trouble with. The first time I
only resolved the problem by recreating the package from the beginning. This
time, recreating the package does not help.

Here is my problem...

I change the catalog of a SQL connection object via script, retrieve some
value then loop back, change the catalog to a different database, retrieve
some, value, etc.

- All the looping works as expected.
- When I execute the steps manually, all values are retrieved from the
correct databases as expected.
- When I run the whole package, the steps loop as expected, but the database
connection refuses to change and I get only the value from the first
database over and over.

- I use msgboxes to display the catalog value of the connection and it shows
the correct database, however, it still uses the wrong one.

It seems I need to force the connection to close so it actually connects to
the new database.
Any ideas?

Jim

Two things to watch-

If you change the connection DB, by default this is overridden because
the DataPump task and DDQ is using the three part name. Loose the first
part.

If a connection is open, then you can change the properties, but they
will not take affect on the "open" instance. In a loop, make sure that
the last task to use a connection has the "Close connection on
completion" option set to true. Right-click - Workflow - Properties -
any task to see the option.

--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.