Automate backup on SQL Express and Send Mail Powershell Script

sql express backup

Sql Server Backup Automation and send-email
Solution to automate backup on SQL Express and send mail based on first Microsoft SQL BackupScript “sp_SQLBackupDatabases”

NB: SQL Server Agent “is not available” on this SQL release
You can schedule jobs with standard “Windows Jobs“ !

How System Works:
3 Objectsd based procedure:
1) batch file > SQL-Backup.bat (Execute ALL Procedure)
2) backup procedure > SP_SQLBackupDatabase.sql (original Microsoft SQL Backup Script)
3) Send mail > Send-email.ps1 (a send email routine based on Powershell Script)

sqlcmd -U sa -P xxxx -S .\SQL2012EXPRESS -Q “EXEC sp_SQLBackupDatabases @backupLocation = ‘C:\SQLBackups\’, @backupType = ‘F’”

Original Microsoft Solution: https://support.microsoft.com/en-us/kb/2019698

MSDN Post Link https://gallery.technet.microsoft.com/Automate-backup-on-SQL-21eb452d
Download link https://gallery.technet.microsoft.com/Automate-backup-on-SQL-21eb452d/file/142818/1/SQL-BackupEmail.zip

2 thoughts on “Automate backup on SQL Express and Send Mail Powershell Script

Leave a Reply

Your email address will not be published. Required fields are marked *

1 × two =

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enjoy this blog? Please spread the word :)

%d bloggers like this: