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

Why This Error Happens

Error 2813 occurs when a T-SQL statement or database feature invoked (such as table partitioning, data compression, Transparent Data Encryption, or Change Data Capture) requires a higher SQL Server edition—typically Enterprise—than the one currently installed. This commonly happens after a database is restored or migrated from an Enterprise instance onto a Standard, Web, or Express edition of SQL Server 2025, or when a script written for Enterprise-only features is run against a lower-tier license. Since the edition is locked at install time, the SQL Server engine blocks the operation at the parser/catalog level, rejecting any syntax or metadata tied to unlicensed capabilities.

Step-by-Step Resolution Guide

Step 1: Identify the Exact Feature Causing the Error

  • Run the failing script in SSMS and note the precise feature name in the %.*ls placeholder (e.g., “Compression,” “Partition,” “Always Encrypted with secure enclaves”).
  • Query sys.dm_db_persisted_sku_features to list any Enterprise-only features currently in use on the database.
  • Check Windows Event Viewer under Applications and Services Logs > MSSQLSERVER for the full error context, including the statement that triggered it.

Step 2: Confirm the Current SQL Server Edition

  • Open SSMS and run:
  SELECT SERVERPROPERTY('Edition') AS Edition, SERVERPROPERTY('EngineEdition') AS EngineEdition;
  • Cross-reference the result against Microsoft’s Edition and Component Reference for SQL Server 2025 to confirm whether the feature you identified in Step 1 is supported.
  • If the server was recently migrated, verify the license key used during setup via C:\Program Files\Microsoft SQL Server\160\Setup Bootstrap\Log\Summary.txt (path may vary by instance/version).

Step 3: Remove or Replace the Unsupported Feature

  • If the feature is non-essential, disable it—for example, disable compression with:
  ALTER TABLE YourTable REBUILD WITH (DATA_COMPRESSION = NONE);
  • For partitioning or CDC, drop the partition scheme/function or disable CDC using sys.sp_cdc_disable_table before re-running your deployment script.
  • Update any deployment or DACPAC scripts to remove Enterprise-specific syntax if targeting Standard or Web edition long-term.

Step 4: Upgrade the Edition (If the Feature Is Required)

  • If the feature is business-critical, use the Edition Upgrade Wizard: run Setup.exe from the SQL Server 2025 installation media and choose Maintenance > Edition Upgrade.
  • Apply a valid Enterprise edition product key when prompted; no reinstall or data loss occurs during an edition upgrade.
  • Restart the SQL Server service (net stop MSSQLSERVER then net start MSSQLSERVER) after the upgrade completes.

Step 5: Validate Database Compatibility Post-Change

  • Re-run DBCC CHECKDB and sp_configure to confirm database integrity and server-level settings are intact.
  • Re-deploy the original script or restore operation to confirm Error 2813 no longer appears.

Alternative or Verification Steps

  • Re-run the exact query or restore operation that originally failed; a successful execution without Error 2813 confirms the fix.
  • If upgrading the edition isn’t feasible, use sys.dm_db_persisted_sku_features periodically to proactively audit for Enterprise-only features before migrating databases to lower editions in the future.