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

Why This Error Happens

This error occurs because TORN_PAGE_DETECTION and PAGE_CHECKSUM are mutually exclusive page-protection mechanisms in SQL Server, and the engine will reject any command attempting to enable both simultaneously on the same database. Since SQL Server 2005, PAGE_CHECKSUM has been the default and superior method for detecting I/O corruption, rendering the legacy TORN_PAGE_DETECTION option obsolete. This typically happens when a database is restored or migrated from a legacy system where a T-SQL script explicitly sets TORN_PAGE_DETECTION ON without first disabling the newer checksum option, or when an automated deployment script contains conflicting ALTER DATABASE statements.

Step-by-Step Resolution Guide

Step 1: Identify the Conflicting Script or Source

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio and locate the specific ALTER DATABASE script that triggered Error 5067.
  • Check if the script contains both SET TORN_PAGE_DETECTION ON and SET PAGE_CHECKSUM ON in the same batch or in close proximity.
  • Review deployment pipelines (e.g., DACPAC files or Flyway scripts) for legacy syntax carried over from older SQL Server versions (2000/2005).

Step 2: Verify the Current Page Verify Option

  • Run the following query to check the current state of the database in question:
SELECT name, page_verify_option_desc 
FROM sys.databases 
WHERE name = 'YourDatabaseName';
  • Confirm whether the value is currently set to NONE, TORN_PAGE_DETECTION, or CHECKSUM.

Step 3: Disable Torn Page Detection and Apply Checksum

  • Execute the following command to correct the database option, ensuring you remove the torn page setting first:
ALTER DATABASE YourDatabaseName 
SET PAGE_VERIFY CHECKSUM;
  • Do not attempt to run SET TORN_PAGE_DETECTION ON in the same transaction or script following this change.
  • If using a GUI, navigate to Database Properties > Options in SSMS and manually select “CHECKSUM” from the Page Verify dropdown menu, rather than using the deprecated boolean toggle.

Step 4: Update Automation Scripts

  • If the error originates from an automated SQL Agent Job or PowerShell deployment script (common in Windows Server 2025 CI/CD pipelines), edit the source files to remove any references to TORN_PAGE_DETECTION.
  • Replace legacy logic with the modern PAGE_VERIFY syntax to prevent future Error 5067 occurrences during subsequent deployments.

Alternative or Verification Steps

  • Verify the Fix: Re-run the sys.databases query from Step 2; the page_verify_option_desc column should now strictly read CHECKSUM with no errors in the SQL Server Error Log.
  • Alternative Solution: If legacy compliance software strictly requires TORN_PAGE_DETECTION for older application compatibility, you must choose one or the other—execute ALTER DATABASE YourDatabaseName SET PAGE_VERIFY NONE; first, then explicitly set TORN_PAGE_DETECTION ON in a separate, standalone transaction.