Automated maintenance for SQL Server Express


One of the drawbacks of using Express Editions of SQL Server is the lack of working SQL Agent Jobs. In particular when you are using Ola Hallengren’s excellent maintenance solution for backups and other maintenance tasks. His FAQ just suggests that you use sqlcmd to execute the stored procedures, but doesn’t give much details. It can be handy to use powershell scripts to embed that call to sqlcmd and perform additional work based on the result code.

Should you need to perform other maintenance tasks, you can replace the execute line with one of the following statements:

You can then schedule those powershell scripts using either the scheduled tasks or the PSScheduledJobs.

 

Leave a comment

Your email address will not be published.

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