Red Gate forums :: View topic - Enhancement request - select database(s) by filtering
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Multi Script 1
SQL Multi Script 1 forum

Enhancement request - select database(s) by filtering

Search in SQL Multi Script 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
dtucker_rw



Joined: 04 Mar 2010
Posts: 2

PostPosted: Thu Mar 04, 2010 11:03 pm    Post subject: Enhancement request - select database(s) by filtering Reply with quote

I'm running in an environment with 8 (soon to be 9) different servers running hundreds of small databases each. I need to be able to run scripts against a subset of databases on each server (databases come and go almost daily, so a list of databases meeting the criteria is a very moving target).

Basically, I'd like to be able to filter databases for selection - e.g. select all databases where database_name like '%-TX' or database_name not like '%Donor%'.

Even if I had to manually refresh the list of databases prior to each execution, that'd be infinitely preferable to spending 15min selecting/deselecting databases one at a time across each server.

Thanks (BTW, quite a slick tool this!)
Back to top
View user's profile Send private message
Linda Hawksworth



Joined: 25 Jun 2007
Posts: 192

PostPosted: Mon Mar 08, 2010 11:03 am    Post subject: Reply with quote

Many thanks for your suggestion. I have logged it as a feature request in our tracking system with reference SE-650. It will be reviewed for a future release of SQL Multi Script although we have no timescales for this at present.
Back to top
View user's profile Send private message
dhtucker



Joined: 15 May 2009
Posts: 41
Location: Dallas/FtWorth, Texas

PostPosted: Tue Aug 10, 2010 12:54 am    Post subject: Reply with quote

FYI: I found a work-around that will suffice for at least simple scripts. It relies on the "On Error:" behavior "Stop executing on database with error" option.

Using a two script approach, script 1 serves to "pre-qualify" the database. I created a simple pass/fail query: "select count(*) from ConfigDistrict" - that's a table guaranteed to exist in each of the databases I'm looking to reach, and equally guaranteed NOT to exist in any of the databases I don't want to reach.

If script 1 fails (i.e. table not found), then script 2 isn't run for that database, but MultiScript forges on to the next database. If script 1 succeeds, then script 2 is invoked for that database.

Suitable only for the simplest, single-script tasks, but it's a start. I do still have to build a Distribution List of "all databases on all servers" every time I've got a task to run (since that list is a moving target), but at least it's a fairly swift "select all, Add>" process.

Idea It would still be nice if an upcoming release gave Distribution Lists some kind of selection criteria or filtering option! Smile
_________________
Doug Tucker
Software Engineer / DBA
RenWeb School Management Software
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group