Automating SQL database backups with SQL Server Express

This forum is where we'll mirror posts that are of value to the community so they may be more easily found.
Post Reply
User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Automating SQL database backups with SQL Server Express

Post by AbleMods » Thu Dec 11, 2008 10:12 am

Found this today and thought I'd share with the community.

http://code.msdn.microsoft.com/SQLExamp ... essBackups

For those that don't know, SQL Server Express doesn't include a scheduling feature. As a result, site admins are unable to automate their database backup process. Shared hosting environments usually don't have this issue as they tend to use the full flavor of SQL Server.

But for less complex installs like mine that use SQL Server Express, it is a constant hassle having to manually run database backups. Using this script, you can quickly execute a single stored procedure to back up all your databases in a single command.

If you're lucky enough to have access to your web server console, you can even use Windows Scheduler to automate the stored procedure. Instructions for the proper command line are included at the end of the stored procedure.

Enjoy!

p.s. and Yes, you SHOULD be backing up your store database(s) on a regular basis. I would do it even in a shared hosting environment. The last thing I want is my entire store history dependent on some rookie college grad making $12/hour working the graveyard shift at the ISP. Check with your hosting provider on their SQL backup (and recovery) procedures.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

Post Reply