In my LiveMeeting session for the AppDev Virtual Chapter of PASS yesterday I talked about building on top of tools that others had already built for you to use. A great one for any DBA to use is the SQL PowerShell Extensions known as SQLPSX. Even if you’ve never used PowerShell before you should take a look at this. Heck even Sys Admins in shops that don’t have a DBA should have a look at this. I have found the commands I have worked with very easy to use; even easier than T-SQL in some cases.
Script Disclaimer, for people who need to be told this sort of thing:
Never trust any script, including those that you find here, until you understand exactly what it does and how it will act on your systems. Always check the script on a test system or Virtual Machine, not a production system. All scripts on this site are performed by a professional stunt driver on a closed course. Your mileage may vary. Void where prohibited. Offer good for a limited time only. Keep out of reach of small children. Do not operate heavy machinery while using this script. If you experience blurry vision, indigestion or diarrhea during the operation of this script, see a physician immediately.
Now this little script here (above) will backup a db for you and even include the current YearMonthDayHourMinute in the file string. This one below will backup all of the non-system databases on your instance. If you’re like me you’re thinking this doesn’t do anything that you can’t already do today with a maintenance plan. That’s true and maybe I should have titled this post “Get Something Done with SQLPSX” but I will build on how you can leverage this more tomorrow. For now, why don’t you add an AND clause only backup all the databases that start with ‘A’ 😉
I’ve gone ahead and included the SQLPSX help items here. Please see if there’s one that catches your eye and see if it might work for you.