Fix "Access Denied" When Creating SQL Server Backup

~10 min read
QBM v2024+
Last updated: January 2025
Key Rule to Remember

SQL Server writes backup files using the SQL Server service account, not your Windows user account. The backup folder must grant write permissions to the account shown in the SQL Server service's "Log On" settings.

1

Check the SQL Server Service Account

Identify which account SQL Server runs under

Before granting any permissions, you need to identify which Windows account the SQL Server service uses. This is the account that needs write access to your backup folder.

How to Check
  1. Press Win + R to open the Run dialog
  2. Type services.msc and press Enter
  3. Find SQL Server (MSSQLSERVER) for default instance, or SQL Server (YourInstanceName) for named instances
  4. Right-click on it and select Properties
  5. Open the Log On tab
  6. Note the account type shown

You will see one of the following account types:

Recommended Backup Location

Create a dedicated backup folder such as C:\QBMBackups\ for your database backups. This keeps backups organized and makes permission management easier.

2

If Log On is "Local System Account"

Grant write permissions to the SYSTEM account

Grant access to: SYSTEM (NT AUTHORITY\SYSTEM)
Choose a Method
GUI Method (Windows Explorer)
  1. Right-click on C:\QBMBackups folder → Properties
  2. Go to Security tab → Click Edit
  3. Click Add → Type SYSTEM
  4. Click Check Names → Click OK
  5. Select Full Control → Click Apply
Command Line Method (Run as Administrator)
Command Prompt
icacls "C:\QBMBackups" /grant "NT AUTHORITY\SYSTEM:(OI)(CI)F"
3

If Log On is "Network Service"

Grant write permissions to the Network Service account

Grant access to: NT AUTHORITY\NETWORK SERVICE
Choose a Method
GUI Method (Windows Explorer)
  1. Right-click on C:\QBMBackups folder → Properties
  2. Go to Security tab → Click Edit
  3. Click Add → Type NETWORK SERVICE
  4. Click Check Names → Click OK
  5. Select Full Control → Click Apply
Command Line Method (Run as Administrator)
Command Prompt
icacls "C:\QBMBackups" /grant "NT AUTHORITY\NETWORK SERVICE:(OI)(CI)F"
4

If Log On is "Local Service"

Grant write permissions to the Local Service account

Grant access to: NT AUTHORITY\LOCAL SERVICE
Command Line Method (Run as Administrator)
Command Prompt
icacls "C:\QBMBackups" /grant "NT AUTHORITY\LOCAL SERVICE:(OI)(CI)F"
GUI Alternative

You can also use the GUI method described in Step 2, but enter LOCAL SERVICE instead of SYSTEM when adding the account.

5

If Log On is "This Account" (Specific User)

Grant write permissions to the exact account shown in service properties

This configuration is common in more secure enterprise environments. The SQL Server service runs under a dedicated domain or local user account.

Grant access to: The exact account shown (e.g., DOMAIN\SqlSvc or .\SqlSvcUser)
Steps to Follow
  1. Create your backup folder (e.g., C:\QBMBackups\)
  2. Right-click on the folder → PropertiesSecurity
  3. Click Add and enter the exact account name you saw under Log On
  4. Grant Full Control (or at minimum: Modify permission for writing files)
Command Line Example
Command Prompt
icacls "C:\QBMBackups" /grant "DOMAIN\SqlSvc:(OI)(CI)F"
Replace with Your Account

Replace DOMAIN\SqlSvc in the command with the actual account name you found in the SQL Server service Log On tab.

6

SQL Server Agent Scheduled Backups

Additional considerations for automated backup jobs

If you're using SQL Server Agent to run scheduled backup jobs, you may also need to check the SQL Server Agent service account.

Check SQL Server Agent Account
  1. Open services.msc
  2. Find SQL Server Agent (MSSQLSERVER) or SQL Server Agent (YourInstanceName)
  3. Check the Log On tab
  4. Grant the same folder permissions to this account if it differs from the SQL Server service account
Job Runs Under SQL Server Account

Even though SQL Server Agent triggers the backup job, the actual BACKUP DATABASE command runs under the SQL Server service account. So the SQL Server service account is the one that needs write access to the backup folder.

Test Your Backup Command
T-SQL
BACKUP DATABASE [YourDatabase]
TO DISK = 'C:\QBMBackups\YourDatabase.bak'
WITH COMPRESSION, INIT;
7

Network Share Backup Considerations

Backing up to a network location (UNC path)

If you want to write backups directly to a network share (e.g., \\NAS\Backups\), additional configuration is required.

Network Service and Local System Limitations

If SQL Server runs as Network Service or Local System, it accesses network shares using the computer account (e.g., DOMAIN\SERVERNAME$). You must grant the computer account write access on the network share.

Options for Network Backups
  1. Use a domain service account: Configure SQL Server to run under a domain user account that has write access to the network share
  2. Grant computer account access: Add DOMAIN\SERVERNAME$ to the share permissions with write access
  3. Backup locally, then copy: Backup to a local folder first, then use a scheduled task to copy files to the network share
Recommended Approach

For reliability, backup to a local folder first (e.g., C:\QBMBackups\), then use a separate process to copy or sync files to network storage or cloud backup.

Quick Support Checklist

  1. 1 Check SQL Server service Log On account via services.msc
  2. 2 Create a backup folder (e.g., C:\QBMBackups\)
  3. 3 Grant folder write permissions based on account type: SYSTEM, NETWORK SERVICE, LOCAL SERVICE, or the specific user
  4. 4 For scheduled backups, verify SQL Server Agent account (backup still runs under SQL Server account)
  5. 5 Test the backup command in SSMS or QBM

Still Having Issues?

If you've followed all the steps above and still encounter "Access Denied" errors when creating backups, please contact QBM Support with the following information: