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

Troubleshooting Guide: Error 12329 – Unsupported Code Page for char(n)/varchar(n) Columns

Why This Error Happens

This error occurs because the feature you are using (such as In-Memory OLTP memory-optimized tables, natively compiled stored procedures, or certain columnstore/temporal operations) only supports non-Unicode string data when the collation’s code page is 1252. SQL Server 2025 enforces this restriction because the underlying engine components rely on a fixed code page mapping for fast, lock-free data access, and any collation mapping to a different code page (such as 1255, 1256, or East Asian code pages) cannot be processed by that engine path. Essentially, a mismatch exists between the column’s collation code page and the specific SQL Server feature’s internal requirements.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Column and Its Collation

  • Run sp_help 'YourTableName' or query sys.columns joined with sys.types to locate all char/varchar columns on the affected object.
  • Check the collation using: SELECT name, collation_name FROM sys.columns WHERE object_id = OBJECT_ID('YourTableName');
  • Cross-reference the collation name against Microsoft’s code page chart — anything not ending in a 1252-mapped collation (e.g., SQL_Latin1_General_CP1_CI_AS) is the root cause.

Step 2: Convert the Column to a Unicode Data Type

  • Change char(n) to nchar(n) and varchar(n) to nvarchar(n) since Unicode types are not restricted by code page.
  • Example migration script:
  ALTER TABLE YourTableName
  ALTER COLUMN YourColumnName NVARCHAR(100) COLLATE SQL_Latin1_General_CP1_CI_AS;
  • Validate that application connection strings and client drivers correctly handle Unicode (SQL_WCHAR) after this change.

Step 3: Re-Collate the Column to a 1252 Code Page (If Unicode Isn’t Feasible)

  • If business requirements prevent switching to Unicode, instead change the collation of the column to one that maps to code page 1252.
  • Use: ALTER TABLE YourTableName ALTER COLUMN YourColumnName VARCHAR(100) COLLATE Latin1_General_CI_AS;
  • Confirm no application logic depends on the original language-specific sorting or comparison rules, as re-collating can affect sort order and comparison results.

Step 4: Rebuild Dependent Objects (Memory-Optimized Tables or Natively Compiled Procs)

  • If the column belongs to a memory-optimized table, you cannot ALTER COLUMN directly — you must export data, drop and recreate the table with the corrected data type/collation, and reload data.
  • For natively compiled stored procedures referencing the column, drop and recreate the procedure after the table schema is fixed.
  • Use bcp or SELECT INTO a staging table to preserve data during the rebuild.

Step 5: Validate Server and Database Default Collation Settings

  • Check the instance-level default collation: SELECT SERVERPROPERTY('Collation');
  • Check the database-level default: SELECT DATABASEPROPERTYEX('YourDatabaseName', 'Collation');
  • If the default collation itself uses a non-1252 code page, consider rebuilding the database (or instance, via setup.exe /ACTION=REBUILDDATABASE) with a 1252-compatible collation if this is a new deployment.

Alternative or Verification Steps

  • After applying fixes, re-run the original operation (table creation, natively compiled proc execution, or memory-optimized table load) and confirm Error 12329 no longer appears in the SQL Server Error Log or Windows Event Viewer.
  • As a quick alternative check, create a test table using NVARCHAR instead of VARCHAR with the same data — if it succeeds without error, this confirms the Unicode code page restriction was the trigger.