I gave him a way to loop through a delimited list offline but your way works
well if he wants to back up everything but sys databases. Or a simpler way
to select only certain databases would be:
select 'exec sp_myproc ', name from master.dbo.sysdatabases
where name in ('DB1','DB2','DB3')
I think it comes down to whether he wants to update and run a single script
or generate a file using this method and run it with osql. Either way should
work.
- Andy O.
________________________________________
From: Michael B. Smith [mailto:[EMAIL PROTECTED]
Sent: Friday, February 29, 2008 2:36 PM
To: NT System Admin Issues
Subject: RE: SQL Scripting Help
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
Im not sure I can give better advice.
~ Upgrade to Next Generation Antispam/Antivirus with Ninja! ~
~ <http://www.sunbelt-software.com/SunbeltMessagingNinja.cfm> ~