Shrink multiple databases at once

Have sql 2008 with about 25 or so Databases, with varying recovery models... backups have been failing so logs have the disk full, I want to set them all to simple and shrink them.  I know how to do it one at a time but was wondering if there is a trick to do all?
LVL 1
leadthewayAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Aneesh RetnakaranDatabase AdministratorCommented:
You have to run the statement on multiple Query windows..

Also you need to figure out to avoid this process in future.  best way to do so is to have proper backups scheduled for these databases.
Shrinking the databases has a performance impact.
0
leadthewayAuthor Commented:
yes i'm aware, but this was dropped into my lap with weeks of no backups..So i guess the answer to my question is no..not shrinking the data, shrinking the log
0
Aneesh RetnakaranDatabase AdministratorCommented:
You can dynamically generate the shrink statements and run in manually each of these statements on each query window. Otherwise its going to be sequential
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
leadthewayAuthor Commented:
yeah i figured, was hoping though..lol, thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.