Just a follow up to my previous post, covering the Automation of SQL Express Backups…
As Brian’s scripts are aimed at non-techies, he wisely coded them to backup all SQL databases on the host. If you’d prefer to back up just one specific SQL database, all you need to do is:
- Open up BackupExpress.sql in an editor.
- Find the line:
PowerShell1select name from sysdatabases where name !='tempdb'
- Remove the exclamation mark, and replace tempdb with the name of your database, like so:
PowerShell1select name from sysdatabases where name ='MyDatabase'
Nice and easy 🙂
If you’re wondering what the exclamation mark does, it means “exclude”. So Brian’s original script backed up every database except tempdb. By removing the exclamation mark, we’re explicitly choosing a database to backup, and excluding all others.