Foreach Loop Container

Last Post 27 Jul 2009 10:50 PM by fosdba. 0 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
New Member
New Member

27 Jul 2009 10:50 PM
Hi there,

I'm looking for an example of how to loop all the databases on a server and run a stored procedure on each of the databases using a Foreach ADO Enumerator.

Currently, I'm using an Execute SQL Task to select the db's from sysdatabases on the server and then pass the dbname via a variable to the Foreach ADO Enumerator as the ADO object source variable. From here I map another variable to the collection value and it works fine. The question is ... how do you them execute a stored procedure on each of these databases within the Foreach Loop Container ?

Thanks in advance.

Acceptable Use Policy