select 'exec sp_myproc ', name from master.dbo.sysdatabases where sid <> 1
Changing the name of sp_myproc to match the name of your stored procedure, is one way to do it (the 'where' clause causes system databases to be exluded). Using this you can generate a list commands that you can then execute using osql in a batch. Without some more information. I'm not sure I can give better advice. Regards, Michael B. Smith MCSE/Exchange MVP http://TheEssentialExchange.com From: Joseph L. Casale [mailto:[EMAIL PROTECTED] Sent: Friday, February 29, 2008 1:09 PM To: NT System Admin Issues Subject: RE: SQL Scripting Help Thanks for the pointer Michael. If I have a comma separated list of values (I can change that format if it makes this easier), how do I iterate through each element pushing it into a variable? Thanks guys, jlc From: Michael B. Smith [mailto:[EMAIL PROTECTED] Sent: Friday, February 29, 2008 5:28 AM To: NT System Admin Issues Subject: RE: SQL Scripting Help Stored procedure. J Regards, Michael B. Smith MCSE/Exchange MVP http://TheEssentialExchange.com From: Joseph L. Casale [mailto:[EMAIL PROTECTED] Sent: Friday, February 29, 2008 1:49 AM To: NT System Admin Issues Subject: SQL Scripting Help I have a series of commands I would like to loop through with a list of db names. Obviously it's much easier to keep a list up to date and organized, then whole bunch of repetitive sets of commands. I can't seem to be able to Google what I am looking for. Anyone got an idea to push me along? Thanks, jlc ~ Upgrade to Next Generation Antispam/Antivirus with Ninja! ~ ~ <http://www.sunbelt-software.com/SunbeltMessagingNinja.cfm> ~
