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

Troubleshooting Guide: SQL Server Error 11031

Why This Error Happens

Error 11031 in Microsoft SQL Server 2025 is an informational message that occurs when a DELETE operation completes successfully, but the client application or script is configured to surface server messages as errors due to logging or severity-level misconfiguration. This typically happens when PRINT statements, triggers, or custom error-handling logic in stored procedures use message IDs in a range that gets misinterpreted by the client’s error-handling layer (such as ODBC or OLE DB drivers) on Windows Server 2025 / Windows 11. It can also surface when SQL Server Agent job steps or SSIS packages are configured to treat all non-zero message severities as failures, even when the severity level indicates success rather than an actual error.

Step-by-Step Resolution Guide

Step 1: Verify the Actual Message Severity and State

  • Open SQL Server Management Studio (SSMS) and run the DELETE statement manually against the target table.
  • Check the Messages tab for the full text: “The row was successfully deleted. (1 row affected)” — confirm the severity level is 0 or 10 (informational), not a true error (severity 11+).
  • Run SELECT * FROM sys.messages WHERE message_id = 11031; to confirm this is a system-defined informational message rather than a blocking error.

Step 2: Review Client Driver and Connection String Settings

  • Navigate to your application’s connection configuration (e.g., ODBC Data Source Administrator on Windows Server 2025/Windows 11 via odbcad32.exe).
  • Check if the driver (SQL Server Native Client, ODBC Driver 18, or OLE DB Driver) has “Report Informational Messages as Errors” or similar flag enabled.
  • Disable this flag, or in application code, explicitly handle SqlInfoMessage events separately from SqlException events (for .NET applications using System.Data.SqlClient or Microsoft.Data.SqlClient).

Step 3: Adjust SQL Server Agent Job Step Logic (If Applicable)

  • Open SQL Server Agent > Jobs in SSMS, right-click the relevant job, and select Properties.
  • Under the Steps tab, edit the step running the delete logic and check the Advanced settings for “On Failure Action.”
  • Modify any TRY...CATCH blocks in your T-SQL code so that THROW or RAISERROR is only triggered for severity levels 11 and above, preventing informational messages like 11031 from halting job execution.

Step 4: Clear Cached Execution Plans and Restart the SQL Service

  • Open PowerShell as Administrator on Windows Server 2025 and run DBCC FREEPROCCACHE; within an SSMS query window first to rule out stale plan issues.
  • If needed, restart the SQL Server service via Restart-Service -Name 'MSSQLSERVER' to ensure configuration changes to drivers or Agent settings take effect.

Alternative or Verification Steps

  • Re-run the original DELETE transaction through the application and confirm no exception is thrown in the application logs, while verifying in SSMS that the row count matches expected results.
  • If the issue persists, create a custom error-handling wrapper in your stored procedure using TRY...CATCH with ERROR_SEVERITY() > 10 as the condition for raising an actual exception, effectively filtering out informational noise like message 11031.