|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 5:48 AM
Points: 3,
Visits: 299
|
|
Ignore that comment Kenneth! Reason for no results was due to SQL Express not listing anything in sys.master_files so failing the query (and one of the engineers dropping ther other test machine I was using off the domain)! Will look into getting the dynamic part of this working now.
thanks again! Adam
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Thursday, May 09, 2013 8:31 AM
Points: 3,367,
Visits: 1,563
|
|
adam_pearson (11/5/2012) Hi Kenneth, Thanks for the example however no joy with that either. Using either a table as the source or hard coding it into the FOREACH container doesn't appear to work. When it executes it runs without problems however only returns the results from the local machine. The servername changes to the ones in the list (using a message box) however when putting items into a table (using the @@servername for example) it's only the location machine being picked up.
I've tried setting the 'delayValidation' setting on and off but still no joy. Tried connecting to different servers but that hasn't helped either.
Any suggestions?
Thanks, Adam
Just to confirm. You are using a FOR EACH loop, not a FOR loop. You have a variable mapped (under the variable mapping tab of the FOR EACH loop container) to store the output of the loop. You have an expression set up on the connection manager that you want to be changing and it uses the variable that you mapped in the FOR EACH loop. And last but not least is the code that you expect to have pointing to the new server inside the loop container?
If all that is true then see if you can walk through the setup on paper and post it to me. I would go ahead and use a Foreach Item Enumerator until you get it working since it has less moving parts to go wrong. Once we have that working then we can work on the next part.
Kenneth Fisher I strive to live in a world where a chicken can cross the road without being questioned about its motives. -------------------------------------------------------------------------------- For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/ For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Link to my Blog Post --> www.SQLStudies.com
|
|
|
|