Alternative method for Maintenance Plan for backups in SQL Server Express 2019

  • Hi there

    We are currently using SQL Server Express 2019 which is limited in aspects including the Maintenance Plan Wizard.

    I would like to set up an automatic job which runs every night and backups our daabases.

    I have thought of using a sqlcmd script and executing tha through windows scheduler. But has anyone done this method

    before or recommend an alternative to using Maintenance Plan?

  • That's what I do on my SQL Express server.

    First step is a batch file to delete backups older than X days

    forfiles.exe /p "C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Backup\SQL_PROD" /s /m *.* /d -21 /c "cmd /c del @file"

    Then batch file to call a stored procedure that does the backups.

    sqlcmd -Q "exec USP_MyDB_Backups" -S ServerName -d DB_Containing_SP

    • This reply was modified 3 years ago by  homebrew01.
  • Task scheduler or a full blown sql server which has batch files to connect to the sql express instance and back it up run via the agent.

  • Hi,

    if you like powershell, take a look at this page:

    https://docs.dbatools.io/Backup-DbaDatabase

    It is quite simple and easy to use. Just build your script and use the windows scheduler.

    Kind regards,

    Andreas

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply