Question

SQL2005 SSIS package ForEach Loop Container Problem when Deployed

Asked by: Draschka

When I deploy my SSIS package to the test server from my production server, I am experiencing an issue with a package I created that uses a For Each loop
I even tried copying the SSIS visual Studio solution and get the same problem.
Oddly enough I do not experience the problem on my development server even when I connect to the SQL server on the test server.
In the For Each Loop container I have a simple Execut SQL task , I am using OLEDB connections
The task simply Deletes records -  here is the statement
DELETE FROM Comm
FROM         Comm INNER JOIN
                      Suppliers ON Comm.SupplierID = Suppliers.SupplierID
WHERE     (Suppliers.House = ?)
I have the parameter mapping set for the Execut SQL Task to the foreach loop variable
works perfectly on the DEV server but on  the test server I get the error
" The multi-part Identifier "Suppliers.House" could not be bound
Schemas are the same, everything is the same except the connection strings
I have attached the .dtsx package for viewing  - its added in a zip file with .txt extension - you can change it back to dtsx extension

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-10-15 at 15:14:44ID24816590
Tags

SQL2005

,

SSIS

Topics

SSIS

,

SQL Server 2005

Participating Experts
2
Points
500
Comments
13

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. FOREACH ADO Enumerator and SSIS
    In SSIS, if I want to loop through a table, pulling out one column in that table based on certain criteria, how do I loop through each returned row? I beleive it is the FOREACH ADO enumerator, but I can't find a simple example on how to put one together. More importantly, h...
  2. SSIS foreach loop
    This question is regarding SSIS: I am trying to loop through a directory of directories that contain directories which contain files. i.e: C:\databases\client1\client1.mdb C:\databases\client2\client2.mdb C:\databases\client3\client3.mdb Does anyone know how to do this? I ...
  3. SSIS ForEach File
    I need to loop through two file types, ARG and ZIP. I use the ForEach container and specify *.zip or *.arg and it works. But I need to do both files. I tried: *.zip ; *.arj *.zip, *.arj They both do not work. Is there anyway to specify more than one file type in fore...
  4. SSIS ForEach / For loop Component
    Hi guys , I have a Directory which has around 6 excel files and I need to extract only 4 files and load it to the same oledb destination ad they have a naming convention like tu_sed_1.xls,tu_sed_2.xls,tu_sed_3.xls and tu_ar.xls for each of these I need to change the value of ...
  5. SSIS Foreach Loop Container
    Does anyone know how to set up a Foreach Loop container in an SSIS 2005 package to transfer (truncate & insert) a set of tables from server A to server B derived from a dynamic list that is housed on Server B? Is this even possible?
  6. SSIS foreach loop traversing directories
    Hi, I'm using SSIS's ForEach Loop Container to traverse directories while storing all path+filenames of files located only in the \Archive directory. The subdirectories may or may not have an \Archive directory located at any level within them. I have the container looping...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: 8080_DiverPosted on 2009-10-17 at 12:56:41ID: 25597216

Can you connect to the test server and execute the SQL statement successfully?

If so, then it sounds like you have a permissions issue somewhere.  Checkj the connection string, determine what user you are effectively logging in as and then check that user's permissions .

If not, that should also provide a clue.

 

by: DraschkaPosted on 2009-10-19 at 09:56:37ID: 25606864

My Package has 3 OleDB Connections
The main oledb connection is for the ForEach LoopContainers query
the others two are set to get their connection strings from a variable that the above query populates

It appears that the forEach Loop is not populating the variables correctly so the connection string is failing. The variable is a string and I have its value set to the dev server. In the foreach loop Editor I set the variable mappings but its not changing the variable

 

by: stelth240Posted on 2009-10-19 at 20:12:22ID: 25610817

When I use the ForEach Loop with the ADO Enumerator selected, I usually use the Recordset Destination to store data into a variable.  I don't know if maybe the Execute SQL Task's full result set doesn't store the data into the variable the same way.  I know the full result set option does create an ADO recordset so it should work, but I don't remember if I've ever used an Execute SQL Task to fill a recordset.

Try creating a data flow task, add an OLE DB Source component, and a Recordset Destination.  Then try putting the same select statement into the source, and consuming it into the Recordset Destination.  I'm not 100% sure it'll fix the problem, but that's what always works for me.

 

by: DraschkaPosted on 2009-10-20 at 09:15:57ID: 25615634

I tried your suggestion and it still does not work. The variable are not being over written and if I leave the value of the variable empty - I get validation errors on the two oledb connections that use those variables as connection strings. If I copy the connection strings from the table where the variables are to be populated from and put that in their values, everything works great.

I have followed every example on the internet that I could find about Dynamic Connection strings for OLEDB connections and for some reason its not working.
For some reason the Variable Mapping on the ForEach loop is not working to populate variables for OLEDB connection strings

 

by: stelth240Posted on 2009-10-20 at 10:04:07ID: 25616179

You need to have an existing string set in the variable before running the package.  Here's a sample I wrote that works correctly.  If you removed the value from the variable in the variables pane, and tried to run it, it won't work correctly.

Just remove the .txt at the end of the name.

 

by: DraschkaPosted on 2009-10-20 at 10:42:15ID: 25616559

I really appreciate your input

Our package is almost identical and I am doing the same thing.

The difference is that if I change what you have as ConnList to a different server than what is in the Dynamic Test connection , it still runs the dataflow on the server thats in the Dynamic Test Connection and not on the server in the connlist. The ConnString Variable is not changing its value

Its simply not working - there is something wrong - I think maybe I need to open a case at microsoft because Im getting no where

 

by: stelth240Posted on 2009-10-20 at 12:04:58ID: 25617300

Do you maybe have RetainSameConnection set to True on the connection manager?  I tried changing the server in my connection and it works fine.  We have a Dev, QA, and Production server at work, and I was able to dynamically change between the Dev and QA servers using this same method.  What I did though which you may not have done is I changed the variable to point to the Production server before changing the data flow task and running the package.  That way, it was able to correctly find a server at first, but then the value was changed as the ForEach Loop ran.

I think the important thing to note is that the variable appears to require a correct connection before running the package.  I don't know if DelayValidation would help on either the Data Flow Task or Connection Manager, but it could be worth a shot.

Are you setting the variable to a valid connection before running the package?  Maybe setting the variable to (local) and master first, and then changing it after.  Also, at that point DelayValidation may need to be set to true on any Data Flow Tasks.

 

by: DraschkaPosted on 2009-10-20 at 12:35:14ID: 25617627

RetainSameConnection is set to false and change the delay validation to true and tried that.

It seems that the connection strings for the variable must be set to the server you are deploying to before you run the package and then it will change the variable . It checks the connection managers first before attempting to run the package.

I was hoping it would just get the connection strings from the table I specified but I guess not. So maybe I need to setup a config file so that I can deploy it to different servers.

 

by: stelth240Posted on 2009-10-20 at 12:51:31ID: 25617829

There is also a DelayValidation on the connection manager itself which might solve your problem (unless you already tried that one).  I didn't try that but that might work.  My issue was that I changed the select statement in the source component, so I had to set the connection to the table I was referencing.  It basically forced me to set a correct string.  I'm wondering though that if I created the data flow task correctly, and then turned on DelayValidation on the connection manager, if it would have worked then.

If not, it just seems that the connection string has to be set to something that exists, either through a package config file or statically in the properties.  I use this same method for a package I wrote, but it changes the connection to an Access database, so it's different.  I did set that to an existing database before deploying it though.

 

by: DraschkaPosted on 2009-10-20 at 14:58:02ID: 25619086

I set DelayValidation everywhere and it did nothing to help. I also created a xml config file. Set the connection manager connection string property of all 3 connection managers and still did not work. If you do not compile the package with the production server where its going to run , then it doesnt work.
So for my deployment I am going to have to make sure the connection string variables have the correct connections to the server where it will be deployed. Only way I can get it to work.

 

by: stelth240Posted on 2009-10-20 at 19:41:56ID: 25620484

Seems like that's the only way to work with it.  I wasn't deploying my package, only debugging it locally, so it seemed to work OK for me.  If it sounds like something that shouldn't happen, you can always write up a bug on the Connect website.  Other than that, I have no further solutions to try on my end.

 

by: DraschkaPosted on 2009-12-08 at 14:43:59ID: 31641901

the only solution is to hard code your connections before deploying - this is failure in the design from microsoft.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...