How to Schedule Database Backups in SQL Server 2012 Express

This guide shows how to schedule database backups in SQL Server 2012 Express using a Windows task or a centralized backup console. It covers account permissions, first-run checks, and a test restore.

Ivy

By Ivy Updated on December 1, 2026

Share this: instagram reddit

SQL Server Express can back up databases, but it lacks SQL Server Agent. This means no built-in scheduling. To automate your backups, you have two options:

  • Use Windows Task Scheduler: Best if you don't mind managing a Windows account and maintaining a short script. (The script example below backs up a database named AppDB.)

  • Use AOMEI Cyber Backup: Best if you prefer a visual console to set schedules, check logs, and find recovery points in one place.

Both methods require you to schedule the backup for a time when the host is running and it won't slow down your application.

Method 1: Schedule Database Backup on SQL Server 2012 Express with Task Scheduler

Set schedule database backup up directly on the SQL Server host. The task will use Windows Authentication to connect, and SQL Server itself will write the backup file.

Before you create the task, make sure both accounts have the right permissions:

  • The Windows account running the task needs to access sqlcmd.exe, read your script, and have SQL permissions to back up AppDB.

  • The SQL Server service account needs write access to the folder where you're saving the backup.

Step 1. In SQL Server Management Studio (SSMS), connect to your SQL Server Express instance. In Object Explorer, expand Databases and confirm the name of the application database you want to back up. Click New Query to open a blank query window.

New Query

Step 2. Copy and paste the script below into the query window.

  • DECLARE @RunTime datetime = GETDATE();
  • DECLARE @BackupFile nvarchar(260);
  • SET @BackupFile = N'D:\SQLBackups\AppDB_'
  • + CONVERT(char(8), @RunTime, 112) + N'_'
  • + REPLACE(REPLACE(CONVERT(char(12), @RunTime, 114), ':', ''), '.', '')
  • + N'.bak';
  • BACKUP DATABASE [AppDB]
  • TO DISK = @BackupFile
  • WITH CHECKSUM;
⚠️Notes:
  • Replace [AppDB] in the BACKUP DATABASE statement with your database name in brackets.
  • In the filename, replace AppDB_ with a short label that identifies the database.
  • Replace D:\SQLBackups with an existing folder on the SQL Server host that the SQL Server service account can write to.
  • The script adds a timestamp to the .bak filename and enables backup checksums.

Step 3. Press Ctrl+S and save the query as C:\SQLScripts\Backup-AppDB.sql. Choose a folder the scheduled task account can read, and keep the full path handy.

Step 4. Open Windows Task Scheduler on the SQL Server host and select Create Task.

Create Task

Step 5. On the General tab, name the task and select the Windows account that will run it. That account needs permission to run sqlcmd.exe and back up the database. Select Run whether user is logged on or not to allow unattended backups.

General

Step 6. On the Triggers tab, click New. Under Begin the task, select On a schedule. Choose Daily, set the Start date and time, and enter a number in the Recur every [ ] days box to set your backup frequency.

On A Schedule

Step 7. On the Actions tab, click New and select Start a program. In Program/script, enter the full path to sqlcmd.exe. In Add arguments, enter the following:

-S .\SQLEXPRESS -E -b -i "C:\SQLScripts\Backup-AppDB.sql"

Start a Program

⚠️Notes:
  • Replace .\SQLEXPRESS if your instance uses a different name. Use the script path from Step 3 after -i.
  • -E switch connects using the task account’s Windows credentials
  • -b lets Task Scheduler detect a SQL error through the exit code.

Step 8. Save the task. In Task Scheduler Library, right-click it and select Run. When it finishes, check that Last Run Result shows 0x0 and that a new timestamped .bak file appears in the backup folder.

After the first scheduled run, check both again and confirm that SQL Server’s msdb backup history shows a full backup for the database at the expected time.

Method 2: Schedule SQL Database Backups in SQL Server 2012 Express with AOMEI Cyber Backup

If you'd rather not deal with managing backup scripts or setting up Windows Task Scheduler, AOMEI Cyber Backup is a great choice. It lets you schedule backups and manage all your SQL database backups from one central console.

The built-in dashboard gives you a clear, real-time view of your backup health. You can instantly see which tasks succeeded, monitor storage usage, and catch any failures early, so you always know exactly when your last good recovery point is.

AOMEI Cyber Backup
Automatic SQL Server Backup Solution 
  • Manage all your SQL database backups from one console.
  • Schedule full backups daily, weekly, or monthly with custom days or intervals, plus optional incremental backups.
  • Fully support Microsoft SQL Server 2012, as well as other versions from SQL Server 2005 up to 2025.
  • Save backups to NAS, local drives, or external storage, and archive to Amazon S3.
  • Recover fast with instant recovery, granular recovery, and more.

Step 1. In the backup console, go to Source Device > Microsoft SQL Server > Add Microsoft SQL. Enter the SQL Server host’s IP address and Windows sign-in credentials, then click Confirm to start the remote agent installation. When it finishes, refresh the Microsoft SQL Server list to find your instance.

Add SQL

Step 2. Click the three-dots icon of the SQL instance, select Authentication > Windows Authentication if this is the first time to install agent. If not, select SQL Authentication instead. Click Verify to continue.

Authentication

Step 3. Go to Task > Backup > Create New Task.

Create New Task

Step 4. Choose Microsoft SQL Backup and enter a unique name to distinguish it from others. 

Select SQL Backup

Step 5. Click Select + next to Device Name and Target to choose the database you want to back up and where to save it, such as a local folder or network share.

Select Database

Step 6. Open Schedule and click the existing schedule settings to change change schedule type, backup time and interval. At last, click Start Backup and choose Add the backup and start backup now.

Schedule

Once the run finishes, open the task details to confirm the backup completed and a recovery point is available.

How to Check That Your SQL Backup Is Restorable

For a native .bak file, run RESTORE VERIFYONLY in SSMS against the backup you intend to keep. This checks that the backup set is complete and readable. Use the actual path to the file created by the scheduled run.

  • RESTORE VERIFYONLY F
  • ROM DISK = N'D:\SQLBackups\AppDB_20261125_020000000.bak';

To verify the recovery process, restore the backup to a compatible non-production SQL Server instance. Use a separate database name and file locations, then open the restored database and check a few tables or application queries you rely on.

For a backup created in AOMEI Cyber Backup, select the recovery point from the relevant task and review the available restore options before choosing the test destination.

Conclusion

Task Scheduler and sqlcmd are a practical choice when you can maintain the script and its Windows account. AOMEI Cyber Backup fits a workflow where you want to configure the schedule and review recovery points in a central console.

SQL Server 2012 has reached the end of extended support, so keep the backup schedule and test restore process in place while you plan the application’s move to a supported version.

Ivy
Ivy · Editor
Ivy, our dedicated editor at AOMEI Technology, is committed to providing valuable insights and guidance in data protection. Her mission is to empower everyone with her knowledge of computer backup and recovery, disk cloning, file synchronization, and more. Ivy's goal is to do her best to ensure your digital world remains safe and secure.