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

Troubleshooting Guide: SQL Server Error 2599

Why This Error Happens

Error 2599 occurs when SQL Server attempts to convert a table’s text, ntext, or image column storage mode to “in-row text” but encounters a conflict preventing the change. This typically happens because the table already has active text pointers, is involved in replication, or has an existing sp_tableoption setting that locks the current large object (LOB) storage configuration. It can also surface due to underlying page-level corruption in the LOB data pages, which prevents SQL Server from safely reorganizing how text data is stored in-row.

Step-by-Step Resolution Guide

Step 1: Verify Table Dependencies and Active Pointers

  • Check if any open transactions are holding text pointers using DBCC OPENTRAN and sys.dm_tran_locks.
  • Run SELECT * FROM sys.dm_db_index_physical_stats (DB_ID(), OBJECT_ID('YourTableName'), NULL, NULL, 'DETAILED'); to inspect LOB page allocation status.
  • Ensure no active connections are using READTEXT, WRITETEXT, or UPDATETEXT commands against the target table.

Step 2: Review and Reset Table Options

  • Open SQL Server Management Studio (SSMS) and connect to the instance running on Windows Server 2025.
  • Execute EXEC sp_tableoption 'YourTableName', 'text in row', 'OFF'; first to clear any conflicting state.
  • Wait for the command to complete, then re-run the desired setting: EXEC sp_tableoption 'YourTableName', 'text in row', '1000'; (replace 1000 with your desired byte limit, up to 7000).
  • If replication is enabled, temporarily disable it via sp_replicationdboption before modifying table options, then re-enable it afterward.

Step 3: Check for Database Corruption

  • Run DBCC CHECKTABLE('YourTableName') WITH ALL_ERRORMSGS, NO_INFOMSGS; to detect LOB page or allocation errors.
  • If corruption is found, restore the table from the most recent validated backup using RESTORE DATABASE with WITH RECOVERY.
  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ to review the ERRORLOG file for correlating I/O or corruption warnings at the time of failure.

Step 4: Rebuild Indexes and Validate Storage Settings

  • Execute ALTER INDEX ALL ON YourTableName REBUILD; to ensure LOB pages are properly reorganized after the option change.
  • Confirm SQL Server service account has sufficient NTFS permissions on the data/log file directories (typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\).

Alternative or Verification Steps

  • Verify the fix by querying sys.tables and checking the text_in_row_limit column value matches your intended configuration, or run sp_help 'YourTableName' to confirm the updated storage setting.
  • If the error persists after these steps, export the table data using bcp utility, drop and recreate the table with the correct text in row option predefined, then reimport the data.