How to fix Error 11806 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 11806 – Invalid Characters in ‘LastBackupName’ Parameter

Why This Error Happens

This error occurs when SQL Server’s backup metadata contains a LastBackupName value with non-ASCII characters, typically introduced through a backup file or path name containing Unicode characters (such as accented letters, non-Latin scripts, or special symbols). SQL Server 2025’s backup validation routines strictly enforce ASCII-only naming for backup set identifiers stored in the msdb database, and this restriction extends to automated backup solutions, maintenance plans, or third-party agents that generate backup file names dynamically. The issue is often triggered by server locale settings, regional naming conventions, or scripts that pull system/user names containing extended characters into the backup file path.

Step-by-Step Resolution Guide

Step 1: Identify the Source of the Invalid Backup Name

  • Check the SQL Server Error Log and Windows Event Viewer (Event ID 11806) for the exact backup operation that triggered the failure.
  • Run the following query to inspect recent backup history for suspicious entries:
  SELECT backup_set_id, name, physical_device_name 
  FROM msdb.dbo.backupset 
  ORDER BY backup_finish_date DESC;
  • Look specifically at the physical_device_name and name columns for non-ASCII characters (e.g., é, ñ, ü, or CJK characters).

Step 2: Correct the Backup File Naming Convention

  • Rename any backup jobs, maintenance plan tasks, or scripts that use dynamic variables (like @@SERVERNAME, SUSER_SNAME(), or environment variables) to generate file names.
  • Update the backup path to use only ASCII-safe naming, for example:
  BACKUP DATABASE [YourDatabase] 
  TO DISK = N'C:\SQLBackups\YourDatabase_Full.bak' 
  WITH INIT, NAME = N'YourDatabase-Full Backup';
  • Avoid pulling in Windows usernames or server names that may include extended Unicode characters, especially on multilingual Windows Server 2025 deployments.

Step 3: Clean Up Corrupted Metadata in msdb

  • If an existing backup set already has an invalid name stored in msdb, remove the problematic entry:
  EXEC msdb.dbo.sp_delete_backuphistory @oldest_date = 'YYYY-MM-DD';
  • Alternatively, manually delete the specific corrupted backup set record using backup_set_id identified in Step 1.
  • Restart the SQL Server Agent service to clear any cached job metadata:
  Restart-Service -Name "SQLSERVERAGENT"

Step 4: Update Regional and Locale Settings (If Applicable)

  • Open Control Panel > Region > Administrative > Change system locale on Windows Server 2025.
  • Ensure the system locale matches the SQL Server instance collation (e.g., SQL_Latin1_General_CP1_CI_AS for English/ASCII environments).
  • Reboot the server after changing locale settings to ensure SQL Server services pick up the updated regional configuration.

Alternative or Verification Steps

  • Run a test backup immediately after applying fixes using a simple ASCII-only file name and confirm it completes without triggering Error 11806: BACKUP DATABASE [TestDB] TO DISK = N'C:\Temp\TestDB.bak';
  • If the error persists, use SQL Server Profiler or Extended Events to trace the exact backup command being executed by any third-party backup tool, as the invalid name may originate from an external agent rather than native SQL Server operations.