Why This Error Happens
Message 4035 (“Processed %I64d pages for database ‘%ls'”) is an informational message generated during BACKUP, RESTORE, or DBCC CHECKDB operations in SQL Server 2025, and it typically surfaces as a symptom when the underlying operation terminates abnormally rather than being an error itself. The root cause is usually an interrupted I/O stream caused by insufficient NTFS permissions on the backup/data directory, a corrupted database page preventing the read from completing, or the SQL Server service account lacking access to the target volume on Windows Server 2025. In some cases, antivirus or Windows Defender real-time scanning locks the .bak or .mdf file mid-operation, causing the page count to halt unexpectedly.
Step-by-Step Resolution Guide
Step 1: Verify Service Account Permissions
- Open Services.msc on Windows Server 2025 / Windows 11 and confirm the SQL Server (MSSQLSERVER) service is running under a valid domain or managed service account.
- Navigate to the backup/data directory (e.g.,
D:\SQLData\Backups) and ensure “NT SERVICE\MSSQLSERVER” has Modify/Write permissions via right-click → Properties → Security. - Run
icacls "D:\SQLData\Backups"in an elevated Command Prompt to confirm ACL entries.
Step 2: Run a Consistency Check to Identify Corruption
- Execute
DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;in SQL Server Management Studio. - Review the output for allocation or consistency errors that may have halted the page-processing operation.
- If corruption is found, note the page ID and object ID for targeted repair.
Step 3: Exclude SQL Directories from Antivirus Scanning
- Open Windows Security → Virus & threat protection → Exclusions on the Windows Server 2025 host.
- Add exclusions for
*.mdf,*.ldf,*.bak, and the full data/log/backup folder paths. - Restart the SQL Server service via
net stop MSSQLSERVER && net start MSSQLSERVERto clear any locked file handles.
Step 4: Re-run the Backup or Restore Operation
- Re-trigger the operation using
BACKUP DATABASE [YourDatabaseName] TO DISK = 'D:\SQLData\Backups\YourDB.bak' WITH CHECKSUM, STATS = 10; - Monitor the SQL Server Error Log (
Management → SQL Server Logs) in real time for confirmation that the full page count completes without interruption.
Alternative or Verification Steps
- Confirm resolution by checking that the final message reports the expected total page count matching the database size, with no accompanying error codes (e.g., 823, 824) in the SQL Server Error Log.
- If the issue persists, restore from a known-good backup to a test instance and run
DBCC CHECKDBthere to isolate whether the corruption is storage-related (check Windows Event Viewer → System log for Disk/NTFS warnings).