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

Troubleshooting Guide: Error 3763 – Object In Use by Change Feed

Why This Error Happens

Error 3763 occurs when an attempt is made to drop, alter, or truncate a table (or database) that is currently enabled for Change Feed, a feature introduced in SQL Server 2025 that continuously streams row-level changes to downstream consumers. SQL Server blocks the operation because Change Feed maintains internal tracking metadata and system objects tied to the table, and modifying the schema or data structure while this tracking is active would corrupt the change stream. This typically happens when administrators forget to disable Change Feed before performing maintenance, migrations, or schema changes.

Step-by-Step Resolution Guide

Step 1: Identify Which Objects Have Change Feed Enabled

  • Run the following query to list all tables with active Change Feed tracking:
  • SELECT name, object_id, is_change_feed_enabled FROM sys.tables WHERE is_change_feed_enabled = 1;
  • Note the exact table name referenced in the error message (%.*ls placeholder).
  • Confirm whether the feed is still actively consumed by a downstream application (Event Hubs, Kafka connector, or Fabric pipeline).

Step 2: Disable Change Feed on the Target Object

  • Open SQL Server Management Studio (SSMS) 21 or Azure Data Studio connected to your SQL Server 2025 instance.
  • Execute the following command to disable Change Feed before altering the table:
  • ALTER TABLE dbo.YourTableName DISABLE CHANGE_FEED;
  • If the error references a database-level feed, disable it at the database scope instead:
  • ALTER DATABASE YourDatabase SET CHANGE_FEED = OFF;

Step 3: Perform the Required Schema or Maintenance Operation

  • Once Change Feed is disabled, retry the original operation (DROP, TRUNCATE, or ALTER).
  • Example: TRUNCATE TABLE dbo.YourTableName;
  • If working in Windows Server 2025, ensure no other service (like SQL Server Agent jobs) is re-enabling Change Feed concurrently via scheduled scripts.

Step 4: Re-enable Change Feed (If Required)

  • If downstream consumers still require the feed, re-enable it after maintenance completes:
  • ALTER TABLE dbo.YourTableName ENABLE CHANGE_FEED;
  • Validate that any associated service broker queues or streaming endpoints reconnect successfully.

Alternative or Verification Steps

  • Verify the fix by re-running the sys.tables query from Step 1 — is_change_feed_enabled should reflect the correct state (0 or 1) and the original DDL command should execute without Error 3763.
  • If disabling Change Feed is not permitted due to governance policies, use sp_change_feed_pause (new in SQL Server 2025) to temporarily suspend tracking instead of fully disabling it, then resume with sp_change_feed_resume after the operation completes.

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

Troubleshooting Guide: SQL Server Error 3761 – Could Not Delete SBS Backed File

Why This Error Happens

Error 3761 occurs when SQL Server’s Snapshot Backup Service (SBS) attempts to clean up a file that was backed by a VSS-based snapshot backup, but the operation fails due to the file being locked, missing, or inaccessible. This is typically caused by insufficient file system permissions for the SQL Server service account, a corrupted or orphaned snapshot metadata entry, or a third-party VSS provider/backup tool holding an exclusive lock on the underlying file. In some cases, the issue stems from a mismatch between the snapshot backup metadata in msdb and the actual state of files on disk, often after an interrupted or forcibly terminated backup job.

Step-by-Step Resolution Guide

Step 1: Verify File System Permissions and File State

  • Open File Explorer or PowerShell and navigate to the SQL Server data directory (typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\).
  • Confirm the file referenced in the error (%ls placeholder in the actual message) exists and check its lock status using Handle.exe or Resource Monitor.
  • Ensure the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control permissions on the file and parent directory.
  • Run: icacls "C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\<filename>" to audit current permissions.

Step 2: Check and Restart the VSS and SQL Writer Services

  • Open Services (services.msc) and confirm SQL Server VSS Writer and Volume Shadow Copy services are running.
  • Restart both services in this order via PowerShell (run as Administrator):
  • net stop "SQLWriter"
  • net stop "VSS"
  • net start "VSS"
  • net start "SQLWriter"
  • Clear any stale VSS shadow copies that may be holding file locks: vssadmin list shadows followed by vssadmin delete shadows /for=<volume> /oldest if orphaned copies are found.

Step 3: Clean Up Orphaned Snapshot Backup Metadata

  • Connect to the SQL Server instance using SQL Server Management Studio (SSMS) or sqlcmd.
  • Query msdb.dbo.backupset and msdb.dbo.backupmediafamily to identify stale snapshot backup records referencing the problematic file.
  • Run DBCC CHECKDB on the affected database to rule out corruption: DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS;
  • If the file is confirmed orphaned and unreferenced by any active database, manually remove it from disk after taking a full backup, then restart the SQL Server service to force metadata resynchronization.

Step 4: Review the SQL Server Error Log for Underlying Cause

  • Open the SQL Server Error Log via SSMS (Management > SQL Server Logs) or navigate to C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Search for accompanying error codes or OS-level error messages (e.g., Error 5 – Access Denied, or Error 32 – File in use) that appear immediately before or after Error 3761.
  • Cross-reference the timestamp with Windows Event Viewer (Applications and Services Logs > Microsoft > Windows > NTFS) to identify any file system-level conflicts.

Alternative or Verification Steps

  • To verify the fix, re-run the snapshot backup job manually using BACKUP DATABASE ... WITH SNAPSHOT and confirm no errors appear in the SQL Server Error Log afterward.
  • If the issue persists, consider disabling third-party antivirus or backup agent real-time scanning on the SQL Server data directory, as these tools frequently cause file-handle conflicts with VSS snapshot operations.

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

Why This Error Happens

Error 3762 occurs when SQL Server cannot obtain an exclusive lock on the database to perform the drop operation because the database is temporarily in use by another process, such as an active transaction, a pending checkpoint, or a system background task like auto-close or snapshot creation. This is also frequently triggered when database mirroring, Always On Availability Groups, or replication processes have a transient hold on the database metadata. In containerized or clustered Windows Server 2025 deployments, latency in resource arbitration between nodes can also cause this temporary unavailability flag to persist.

Step-by-Step Resolution Guide

Step 1: Identify Active Connections and Blocking Sessions

  • Open SQL Server Management Studio (SSMS) and run sp_who2 or query sys.dm_exec_sessions to check for active connections to the target database.
  • Look specifically for sessions with a status of sleeping or runnable that reference the database you are trying to drop.
  • Terminate lingering sessions using KILL <session_id>; if they are safe to terminate.

Step 2: Force Single-User Mode Before Dropping

  • Run the following command to isolate the database and clear any lingering background locks:
ALTER DATABASE [YourDatabaseName] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • Wait 10-15 seconds to allow Windows Server 2025 I/O subsystems to flush pending writes.
  • Attempt the drop command again: DROP DATABASE [YourDatabaseName];

Step 3: Check for Availability Group or Mirroring Locks

  • If the database is part of an Always On Availability Group, you must remove it from the AG first using ALTER AVAILABILITY GROUP [AGName] REMOVE DATABASE [YourDatabaseName];.
  • Verify mirroring status via SELECT * FROM sys.database_mirroring WHERE mirroring_guid IS NOT NULL; and break the mirror if necessary using ALTER DATABASE [YourDatabaseName] SET PARTNER OFF;.

Step 4: Restart the SQL Server Service

  • If the lock persists, the metadata cache may be corrupted in memory.
  • Navigate to Services.msc on your Windows Server 2025 instance, locate SQL Server (MSSQLSERVER), and select Restart.
  • Alternatively, use PowerShell: Restart-Service -Name 'MSSQLSERVER' -Force.

Alternative or Verification Steps

  • To verify the fix, query sys.databases to ensure the database no longer appears in the list: SELECT name FROM sys.databases WHERE name = 'YourDatabaseName';
  • If the error persists after a service restart, check the Windows Event Viewer under Applications and Services Logs > MSSQLSERVER for underlying I/O or disk subsystem errors that may be preventing the file handle release.

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

Troubleshooting Guide: Error 3760 – Cannot Drop Index on View with SNAPSHOT_MATERIALIZATION

Why This Error Happens

This error occurs because SQL Server 2025 protects indexed views that have been enabled for SNAPSHOT_MATERIALIZATION by preventing the removal of their underlying clustered index through a standard DROP INDEX statement. The engine relies on this specific index to maintain the materialized snapshot state used for temporal consistency and read-committed snapshot isolation on the view. Attempting to drop the index directly—rather than disabling the materialization property first—violates the metadata dependency chain, triggering this safety block.

Step-by-Step Resolution Guide

Step 1: Verify the View’s Materialization Status

  • Open SQL Server Management Studio (SSMS) 21 or Azure Data Studio connected to your SQL Server 2025 instance.
  • Run the following query to confirm the view is using snapshot materialization:
  SELECT name, is_snapshot_materialized 
  FROM sys.views 
  WHERE object_id = OBJECT_ID('YourSchema.YourViewName');
  • Confirm the result returns 1 for is_snapshot_materialized before proceeding.

Step 2: Disable Snapshot Materialization on the View

  • You cannot drop the index while this property is active; it must be turned off first using an ALTER VIEW statement.
  • Execute the following T-SQL command:
  ALTER VIEW YourSchema.YourViewName 
  SET (SNAPSHOT_MATERIALIZATION = OFF);
  • If this command fails due to active transactions, check sys.dm_tran_active_transactions to ensure no open transactions are referencing the view.

Step 3: Drop the Index Successfully

  • Once materialization is disabled, re-attempt the original index removal command.
  • Use the standard syntax, specifying both the index name and the view name:
  DROP INDEX YourIndexName ON YourSchema.YourViewName;
  • If you intend to modify the index rather than remove it permanently, consider using DROP_EXISTING = ON within a CREATE INDEX statement instead to avoid rebuilding materialization logic later.

Step 4: Re-enable Materialization (Optional)

  • If the view requires snapshot materialization for application logic after the index change, re-create the required clustered index first.
  • Then, turn the feature back on:
  ALTER VIEW YourSchema.YourViewName 
  SET (SNAPSHOT_MATERIALIZATION = ON);

Alternative or Verification Steps

  • Verification: Run SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID('YourSchema.YourViewName'); to confirm the specific index ID no longer appears in the result set.
  • Alternative: If ALTER VIEW fails due to schema binding conflicts, you may need to drop and recreate the view entirely without the WITH SCHEMABINDING clause temporarily, apply your index changes, and then restore the schema binding and materialization settings in a single batch.

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

Troubleshooting Guide: SQL Server Error 3759

Why This Error Happens

Error 3759 occurs when attempting to drop a constraint using the ALTER TABLE ... DROP CONSTRAINT statement combined with the WAIT_AT_LOW_PRIORITY option, but the constraint type does not support this low-priority locking mechanism. This typically happens because WAIT_AT_LOW_PRIORITY is designed specifically for online index operations and certain constraint modifications, not for all constraint types (such as DEFAULT, CHECK, or PRIMARY KEY constraints in specific states). The underlying cause is a syntax misuse where the low-priority wait abstraction layer is applied to a DDL operation that SQL Server’s Lock Manager does not recognize as eligible for priority-based lock queuing.

Step-by-Step Resolution Guide

Step 1: Identify the Constraint Type Causing the Conflict

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio connected to your SQL Server 2025 instance.
  • Run a query against sys.objects and sys.key_constraints to determine the exact type of constraint being dropped:
SELECT name, type_desc FROM sys.objects WHERE name = 'YourConstraintName';
  • Confirm whether the constraint is a DEFAULT, FOREIGN KEY, CHECK, or UNIQUE constraint, as only specific types support low-priority waits.

Step 2: Remove the Unsupported WAITATLOW_PRIORITY Clause

  • Modify your T-SQL script to drop the WITH (WAIT_AT_LOW_PRIORITY) clause from the ALTER TABLE statement if the constraint type is unsupported.
  • Example of the corrected syntax:
ALTER TABLE dbo.YourTable 
DROP CONSTRAINT YourConstraintName;
  • If you specifically need low-priority locking behavior, ensure you are only applying it to index rebuild or switch operations where it is natively supported.

Step 3: Apply Low-Priority Locking Correctly (If Required)

  • If low-priority locking is a business requirement to avoid blocking production traffic, wrap the constraint drop in an index-level operation instead, or use a retry logic loop with standard locking.
  • Alternatively, use the correct syntax for supported scenarios, specifying MAX_DURATION and ABORT_AFTER_WAIT:
ALTER TABLE dbo.YourTable 
DROP CONSTRAINT YourConstraintName 
WITH (ONLINE = ON (WAIT_AT_LOW_PRIORITY (MAX_DURATION = 5 MINUTES, ABORT_AFTER_WAIT = SELF)));
  • Verify your SQL Server 2025 edition (Enterprise vs. Standard) supports the Online DDL features required for this syntax on Windows Server 2025.

Step 4: Check Compatibility Level of the Database

  • Navigate to the Database Properties in SSMS and check the “Compatibility Level” under the Options tab.
  • Ensure the database compatibility level is set to 160 (SQL Server 2022) or higher to support the latest syntax parsing for constraint management in SQL Server 2025.
  • Update if necessary using:
ALTER DATABASE YourDatabaseName SET COMPATIBILITY_LEVEL = 170;

Alternative or Verification Steps

  • Verify the Fix: Re-run the ALTER TABLE command without the error; check the sys.dm_exec_requests DMV to ensure no blocking or lock timeout occurred during the operation.
  • Alternative Solution: If low-priority waiting is strictly necessary, perform the drop during a scheduled maintenance window using standard locking (without the WAIT_AT_LOW_PRIORITY clause) to bypass the need for priority-based lock queuing entirely.

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

Troubleshooting Guide: Error 3758 – Multiple Indexes Cannot Be Dropped with WAITATLOW_PRIORITY

Why This Error Happens

Error 3758 occurs when a DROP INDEX statement targets multiple indexes in a single statement while also specifying the WAIT_AT_LOW_PRIORITY clause under the ALTER_LOCKS option. SQL Server 2025 requires each low-priority wait operation to be isolated to a single index because the engine manages lock queue priority, abort behavior (ABORT_AFTER_WAIT), and blocker session termination on a per-object basis. When multiple index names are batched together, SQL Server cannot deterministically apply a single low-priority locking strategy across separate internal metadata objects, so it rejects the statement outright rather than risk inconsistent lock behavior.

Step-by-Step Resolution Guide

Step 1: Identify the Offending T-SQL Statement

  • Review the script or stored procedure that triggered Error 3758.
  • Look specifically for a DROP INDEX statement listing more than one index, such as:
    DROP INDEX IX_Orders_1 ON dbo.Orders, IX_Orders_2 ON dbo.Orders WITH (ONLINE = ON, WAIT_AT_LOW_PRIORITY (MAX_DURATION = 5 MINUTES, ABORT_AFTER_WAIT = SELF));
  • Confirm this pattern using SQL Server Management Studio (SSMS) 21 or Azure Data Studio query history logs.

Step 2: Split the Statement Into Individual DROP INDEX Commands

  • Rewrite the batch so each index drop is its own statement, each with its own WAIT_AT_LOW_PRIORITY clause.
  • Example corrected syntax:
    DROP INDEX IX_Orders_1 ON dbo.Orders WITH (ONLINE = ON, WAIT_AT_LOW_PRIORITY (MAX_DURATION = 5 MINUTES, ABORT_AFTER_WAIT = SELF));
    DROP INDEX IX_Orders_2 ON dbo.Orders WITH (ONLINE = ON, WAIT_AT_LOW_PRIORITY (MAX_DURATION = 5 MINUTES, ABORT_AFTER_WAIT = SELF));
  • Save this as a sequential script rather than a comma-separated multi-index call.

Step 3: Wrap Statements in a Controlled Execution Block

  • Use a BEGIN TRY...END TRY / BEGIN CATCH...END CATCH block around each individual drop so a failure on one index does not halt the entire maintenance job.
  • Log failures to a tracking table (e.g., dbo.IndexMaintenanceLog) so you can audit which drops succeeded under low-priority locking and which timed out.

Step 4: Update Maintenance Scripts and Automation Jobs

  • Check SQL Server Agent jobs, Ola Hallengren maintenance scripts, or third-party index maintenance tools for any batch-style DROP INDEX calls.
  • Modify the job step source in SQL Server Agent (via SSMS > SQL Server Agent > Jobs > Job Steps) to reflect the one-index-per-statement pattern.

Step 5: Test in a Non-Production Environment

  • Deploy the corrected script to a staging instance running SQL Server 2025 on Windows Server 2025 first.
  • Confirm the script executes without raising Error 3758 before pushing to production.

Alternative or Verification Steps

  • Run the corrected script against a test database and check sys.messages or the SQL Server Error Log (via SSMS > Management > SQL Server Logs) to confirm Error 3758 no longer appears.
  • If low-priority waits are not strictly required, as a fallback, remove the WAIT_AT_LOW_PRIORITY clause entirely and schedule the multi-index drop during a low-traffic maintenance window instead.

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

Troubleshooting Guide: SQL Server Error 3757 — “WAITATLOW_PRIORITY clause is not permitted without ONLINE = ON option”

Why This Error Happens

This error occurs because the WAIT_AT_LOW_PRIORITY option is a concurrency-control clause that only applies to online index or table maintenance operations. When a T-SQL statement specifies WAIT_AT_LOW_PRIORITY (with MAX_DURATION and ABORT_AFTER_WAIT) but does not explicitly set ONLINE = ON, the SQL Server query parser rejects the batch because there is no “low priority lock queue” to wait in during an offline rebuild. Essentially, this is a syntax dependency conflict, not a permissions or corruption issue — the engine requires the online operation context for the low-priority wait logic to have any functional meaning.

Step-by-Step Resolution Guide

Step 1: Locate the Offending T-SQL Statement

  • Open SQL Server Management Studio (SSMS) 21 or Azure Data Studio connected to your SQL Server 2025 instance.
  • Review the script, stored procedure, or maintenance job (check SQL Server Agent job steps under SQL Server Agent > Jobs in Object Explorer) that triggered Error 3757.
  • Identify the ALTER INDEX or ALTER TABLE statement containing the WAIT_AT_LOW_PRIORITY clause.

Step 2: Add the Missing ONLINE = ON Clause

  • Modify the statement to explicitly include ONLINE = ON alongside the WAIT_AT_LOW_PRIORITY option.
  • Example corrected syntax:
ALTER INDEX IX_Orders_CustomerID ON dbo.Orders
REBUILD WITH (
    ONLINE = ON (
        WAIT_AT_LOW_PRIORITY (
            MAX_DURATION = 5 MINUTES,
            ABORT_AFTER_WAIT = BLOCKERS
        )
    )
);
  • Ensure correct nesting of parentheses, as WAIT_AT_LOW_PRIORITY must be a sub-clause within the ONLINE option, not a sibling clause.

Step 3: Confirm Edition Support for Online Operations

  • Verify your SQL Server 2025 edition (Enterprise or Developer) supports Online Index Operations, as this feature is not available in Standard Edition.
  • Run the following query to check:
SELECT SERVERPROPERTY('Edition') AS Edition;
  • If running Standard Edition, remove the ONLINE = ON and WAIT_AT_LOW_PRIORITY clauses entirely and schedule the rebuild during a maintenance window instead.

Step 4: Re-deploy and Test the Script

  • Save the corrected script and re-run it against a test/staging database first.
  • If deployed via a CI/CD pipeline or DACPAC, redeploy the updated schema object to Windows Server 2025 hosted instances.

Alternative or Verification Steps

  • Re-execute the corrected ALTER INDEX/ALTER TABLE command and confirm it completes without raising Error 3757 in the Messages tab of SSMS.
  • As an alternative, if low-priority waiting isn’t critical, remove the WAIT_AT_LOW_PRIORITY clause entirely and keep only ONLINE = ON — this still allows concurrent access without the wait-queue behavior.

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

Why This Error Happens

This error occurs because SQL Server 2025 prevents a DROP DATABASE operation when one or more file snapshots (used for features like database cloning or point-in-time recovery snapshots) are still associated with the database. The underlying VDI (Virtual Device Interface) or sparse file snapshot references lock the database files at the filesystem level, meaning SQL Server cannot safely remove the physical files until those dependent snapshots are cleaned up. This typically happens after using database cloning features (DBCC CLONEDATABASE) or third-party backup tools that leverage Volume Shadow Copy Service (VSS) snapshots.

Step-by-Step Resolution Guide

Step 1: Identify Existing File Snapshots

  • Open SQL Server Management Studio (SSMS) and connect to the instance via a New Query window.
  • Run the following query to list active snapshots tied to the database:
  SELECT * FROM sys.database_file_snapshots;
  • Note the database_name and snapshot_id values returned, as you will need these to target the cleanup.

Step 2: Delete the File Snapshots Manually

  • Execute the sp_delete_file_snapshot stored procedure to remove the orphaned snapshot metadata and clear the lock:
  EXEC sp_delete_file_snapshot N'<Full_Path_To_Snapshot_File>';
  • If the exact file path is unknown, cross-reference the path column from the sys.database_file_snapshots query in Step 1.
  • Repeat this command for every snapshot entry associated with the problematic database.

Step 3: Verify Filesystem Lock Release

  • Navigate to the default data directory (typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA) using File Explorer or PowerShell.
  • Check if the .vhdx or sparse file snapshot artifacts have been removed from the disk following the EXEC command.
  • If files remain locked, restart the SQL Server (MSSQLSERVER) service via the Services console (services.msc) on Windows Server 2025 to release any lingering file handles.

Step 4: Retry the Drop Command

  • Return to your query window and attempt the deletion again:
  DROP DATABASE [YourDatabaseName];
  • Confirm that Error 3755 no longer appears in the Messages tab of SSMS.

Alternative or Verification Steps

  • Verification: Run SELECT name FROM sys.databases WHERE name = 'YourDatabaseName'; to confirm the database no longer exists in the instance catalog.
  • Alternative Fix: If snapshots cannot be deleted due to active application connections, use ALTER DATABASE [YourDatabaseName] SET OFFLINE WITH ROLLBACK IMMEDIATE; followed by a database Detach (right-click DB > Tasks > Detach) rather than a hard drop, then manually delete the physical .mdf, .ldf, and snapshot files from the Windows Server 2025 file system.

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

Troubleshooting Guide: Error 3756 – TRUNCATE TABLE Statement Failed (Index Not Partitioned)

Why This Error Happens

This error occurs when you attempt to execute a TRUNCATE TABLE statement with a WITH PARTITIONS clause on a table where one or more indexes do not share the same partitioning scheme as the base table. In SQL Server 2025, all indexes—including non-clustered indexes—must be aligned (partitioned identically) with the table for partition-level truncation to succeed. This commonly happens when a non-clustered index was created using a different partition scheme or was explicitly created as a non-partitioned (standalone filegroup) index while the base table remains partitioned.

Step-by-Step Resolution Guide

Step 1: Identify the Misaligned Index

  • Run the following query to find indexes that are not partition-aligned with the base table:
  • SELECT i.name AS IndexName, s.name AS SchemeName FROM sys.indexes i LEFT JOIN sys.partition_schemes s ON i.data_space_id = s.data_space_id WHERE i.object_id = OBJECT_ID('YourTableName');
  • Check the Event Viewer under Applications and Services Logs > MSSQLSERVER for the specific index name referenced in Error 3756.
  • Cross-reference the index name with sys.partitions to confirm it does not match the partition_number scheme of the clustered index.

Step 2: Drop and Recreate the Index with the Correct Partition Scheme

  • Script out the existing index definition using SSMS (Right-click Index > Script Index as > CREATE To).
  • Drop the non-aligned index:
  • DROP INDEX IX_YourIndexName ON YourTableName;
  • Recreate the index explicitly specifying the same partition scheme and column used by the base table:
  • CREATE NONCLUSTERED INDEX IX_YourIndexName ON YourTableName (ColumnName) ON YourPartitionScheme(PartitionColumn);

Step 3: Validate Partition Function and Scheme Consistency

  • Navigate to SQL Server Management Studio (SSMS) > Databases > YourDB > Storage > Partition Schemes to visually confirm alignment.
  • Ensure the Windows Server 2025 host has sufficient disk space on all filegroups mapped in the partition scheme (check via Server Manager > File and Storage Services).
  • Restart the SQL Server (MSSQLSERVER) service via services.msc if metadata caching appears to be causing a false positive on alignment checks.

Step 4: Re-run the TRUNCATE Statement

  • Execute the original command again with the specific partition number targeted:
  • TRUNCATE TABLE YourTableName WITH (PARTITIONS (1));
  • Monitor the Messages tab in SSMS to confirm the command completes without Error 3756.

Alternative or Verification Steps

  • Verify Fix: Query sys.indexes joined with sys.partition_schemes again to ensure the data_space_id matches between the clustered index and all non-clustered indexes on the table.
  • Alternative Solution: If recreating the index is not immediately feasible due to table size, use a standard DELETE statement with a WHERE clause targeting the specific partition boundary values instead of TRUNCATE ... WITH PARTITIONS, though this will generate more transaction log overhead.

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

Troubleshooting Guide: Error 3754 – TRUNCATE TABLE Statement Failed Due to Partition Function Dependency

Why This Error Happens

This error occurs because the table you are attempting to truncate has one or more indexes that are partition-aligned with a partition function, and at least one of the referenced partitions is either not empty or the index structure conflicts with the TRUNCATE operation’s requirement for whole-partition clearing. SQL Server 2025 enforces strict validation on partitioned indexes to prevent silent data loss when a TRUNCATE TABLE ... WITH PARTITIONS clause is omitted or misconfigured. Additionally, this can surface when a non-aligned index exists on a partitioned table, which violates the metadata consistency SQL Server requires before allowing a truncate operation to proceed.

Step-by-Step Resolution Guide

Step 1: Identify the Conflicting Index and Partition Function

  • Run the following query to find the exact index and partition function named in the error:
SELECT i.name AS IndexName, ps.name AS PartitionScheme, pf.name AS PartitionFunction
FROM sys.indexes i
JOIN sys.partition_schemes ps ON i.data_space_id = ps.data_space_id
JOIN sys.partition_functions pf ON ps.function_id = pf.function_id
WHERE i.object_id = OBJECT_ID('YourSchema.YourTableName');
  • Confirm whether the index is “aligned” (uses the same partition scheme as the base table) or “non-aligned.”

Step 2: Specify the Correct Partitions in the TRUNCATE Statement

  • Instead of truncating the entire table, explicitly define which partitions to clear using the WITH (PARTITIONS (...)) syntax:
TRUNCATE TABLE YourSchema.YourTableName
WITH (PARTITIONS (2, 4, 6 TO 8));
  • Verify the partition numbers using sys.partitions and match them against partition_number for your target rows.

Step 3: Rebuild Non-Aligned Indexes to Match the Partition Scheme

  • If Step 1 revealed a non-aligned index, drop and recreate it using the same partition scheme as the clustered index:
DROP INDEX YourIndexName ON YourSchema.YourTableName;
CREATE NONCLUSTERED INDEX YourIndexName 
ON YourSchema.YourTableName (YourColumn)
ON YourPartitionScheme(YourPartitioningColumn);
  • This realigns the index so that TRUNCATE operations can process partitions uniformly.

Step 4: Check for Foreign Key References Blocking Partition Truncation

  • Query sys.foreign_keys to ensure no foreign key constraints reference the partitioned table, as this can compound the 3754 error in SQL Server 2025:
SELECT * FROM sys.foreign_keys WHERE referenced_object_id = OBJECT_ID('YourSchema.YourTableName');
  • Temporarily disable or drop conflicting constraints if truncation of specific partitions is still required.

Step 5: Apply the Latest Cumulative Update for SQL Server 2025

  • Navigate to the SQL Server Installation Center via Start > Microsoft SQL Server 2025 > SQL Server Installation Center.
  • Check for and install the latest Cumulative Update (CU), as early 2025 builds had a known metadata validation bug affecting partition-aligned index checks during truncation.

Alternative or Verification Steps

  • After applying the fix, re-run the original TRUNCATE TABLE statement on a test/staging environment first to confirm Error 3754 no longer appears.
  • If the error persists, use DELETE with a WHERE clause targeting the specific partition boundary values as a temporary workaround while you investigate index alignment further.

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

Troubleshooting Guide: Error 3752 – Database Cannot Be Dropped While Joined to Availability Group

Why This Error Happens

This error occurs because SQL Server 2025 prevents a database from being dropped while it remains a member of an Availability Group (AG), as the database still has active replication metadata and synchronization dependencies linking it to the AG topology. The database must be explicitly removed from the availability group before the drop operation is permitted, since SQL Server protects AG-joined databases from accidental deletion that could disrupt failover configurations or cause data loss on secondary replicas. This commonly happens when administrators attempt to drop a database directly without first removing it from the AG through the proper Always On workflow.

Step-by-Step Resolution Guide

Step 1: Identify the Availability Group Membership

  • Run SELECT name, replica_id, group_database_id FROM sys.dm_hadr_database_replica_states WHERE database_id = DB_ID('YourDatabaseName'); to confirm AG membership.
  • Note the Availability Group name using SELECT ag.name AS AGName FROM sys.availability_groups ag;

Step 2: Remove the Database from the Availability Group

  • On the primary replica, run: ALTER AVAILABILITY GROUP [YourAGName] REMOVE DATABASE [YourDatabaseName];
  • Alternatively, use SQL Server Management Studio (SSMS): navigate to Always On High Availability > Availability Groups > YourAGName > Availability Databases, right-click the database, and select Remove Database from Availability Group.
  • Verify the removal completed on all replicas (primary and secondary) before proceeding.

Step 3: Drop the Database

  • Once removed from the AG, run DROP DATABASE [YourDatabaseName]; on the instance where the database resides.
  • If the database still shows as “Restoring” on secondary replicas, manually drop it there as well using the same command.

Step 4: Clean Up Residual AG Metadata (If Needed)

  • Check sys.availability_databases_cluster for orphaned entries referencing the dropped database.
  • Restart the SQL Server service or run ALTER AVAILABILITY GROUP [YourAGName] FORCE_FAILOVER_ALLOW_DATA_LOSS; only if metadata remains inconsistent (use with caution in production).

Alternative or Verification Steps

  • Verify the fix by querying sys.databases and sys.dm_hadr_database_replica_states to confirm the database no longer appears in AG-related views and was successfully dropped.
  • If the error persists, check Windows Server Failover Cluster (WSFC) resources via Get-ClusterResource in PowerShell to ensure no stale cluster resources are still referencing the database.

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

Troubleshooting Guide: SQL Server Error 3751

Why This Error Happens

Error 3751 occurs when SP_DROPEXTENDEDPROC or DBCC DROPEXTENDEDPROC is used against an object that is not actually registered as an extended stored procedure, such as a regular stored procedure, scalar function, or system object. SQL Server validates the object type in sys.objects/sys.extended_procedures before allowing the drop operation, and a type mismatch (commonly %S_MSG reporting “stored procedure” instead of “extended stored procedure”) triggers this block. This typically happens after a migration, a naming collision, or when scripts written for legacy XP-based procedures are run against objects that were never created with sp_addextendedproc.

Step-by-Step Resolution Guide

Step 1: Confirm the Object Type Before Dropping

  • Run the following query to check how SQL Server classifies the object:
SELECT name, type, type_desc 
FROM sys.objects 
WHERE name = 'YourObjectName';
  • Look at the type_desc column — extended stored procedures will show EXTENDED_STORED_PROCEDURE, while regular ones show SQL_STORED_PROCEDURE.
  • If the type does not match XP, the drop command you are using is incorrect for this object.

Step 2: Use the Correct Drop Command for the Object Type

  • If the object is a standard stored procedure, use:
DROP PROCEDURE YourObjectName;
  • If the object is a scalar/table-valued function instead, use:
DROP FUNCTION YourObjectName;
  • Only use sp_dropextendedproc or DBCC DROPEXTENDEDPROC when sys.extended_procedures actually lists the object.

Step 3: Check for Naming Conflicts or Duplicate Objects

  • Search across all schemas to ensure there isn’t a naming collision:
SELECT s.name AS schema_name, o.name, o.type_desc 
FROM sys.objects o
JOIN sys.schemas s ON o.schema_id = s.schema_id
WHERE o.name = 'YourObjectName';
  • If duplicates exist in different schemas, fully qualify the object name (e.g., dbo.YourObjectName) in your drop statement to target the correct one.

Step 4: Validate Extended Procedure DLL Registration

  • If you expected this to be an XP, confirm it was registered properly using:
SELECT * FROM sys.extended_procedures;
  • If the procedure is missing from this list, it was never registered as an extended procedure — re-register it with sp_addextendedproc 'YourObjectName', 'YourDLL.dll'; if required, or abandon the XP drop approach entirely since SQL Server 2025 strongly discourages XPs in favor of CLR integration or external language extensions.

Step 5: Restart SSMS/Query Session and Re-Test

  • Close and reopen your SQL Server Management Studio (SSMS) session or query window to clear any cached metadata.
  • Re-run the corrected drop statement from Step 2 against the validated object.

Alternative or Verification Steps

  • Verify success by re-querying sys.objects for the target name — it should return no rows if the drop succeeded.
  • If the object still cannot be dropped due to dependency locks, check sys.sql_expression_dependencies for references and remove dependent objects first before retrying.

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

Troubleshooting Guide: SQL Server Error 3749 – Cannot Drop XML Index Using Old ‘Table.Index’ Syntax

Why This Error Happens

This error occurs because SQL Server 2025 has deprecated the legacy DROP INDEX table.index_name syntax specifically for XML indexes, requiring the newer ANSI-standard DROP INDEX index_name ON table_name format instead. The old syntax parser cannot correctly resolve the index-to-table relationship for XML index types, triggering a parsing failure. This is purely a T-SQL syntax compatibility issue and is not related to permissions, corruption, or connectivity.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Script or Query

  • Locate the T-SQL script, stored procedure, or application code generating the DROP INDEX statement.
  • Search for patterns matching DROP INDEX [TableName].[IndexName].
  • Use SQL Server Management Studio (SSMS) 21 or Azure Data Studio to open the script for editing.

Step 2: Rewrite the Statement Using ANSI Syntax

  • Replace the old syntax with the supported format: DROP INDEX IndexName ON TableName;
  • Example fix: Change DROP INDEX Employees.IX_XML_Resume to DROP INDEX IX_XML_Resume ON Employees;
  • If dropping a primary XML index, ensure no secondary XML indexes (PATH, VALUE, PROPERTY) depend on it, as they must be dropped first in the same corrected syntax.

Step 3: Update Dependent Automation and Deployment Scripts

  • Check SQL Server Agent Jobs, SSIS packages, and DevOps/CI pipeline scripts (e.g., files in C:\Program Files\Microsoft SQL Server\160\DTS\Packages\) for the deprecated syntax.
  • Update any database migration tools (like DACPAC or Liquibase changesets) to use the new syntax to prevent future deployment failures.

Step 4: Execute and Validate in a Test Environment

  • Run the corrected script against a non-production instance of SQL Server 2025 first.
  • Confirm the command executes without returning Error 3749 or any syntax warnings.

Alternative or Verification Steps

  • Verification: Run SELECT * FROM sys.indexes WHERE name = 'YourIndexName' after execution to confirm the index no longer exists in the schema.
  • Alternative: If modifying legacy application code is not immediately feasible, wrap the drop logic in a sp_executesql dynamic SQL block using the new syntax to bridge compatibility without altering the core application structure immediately.

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

Troubleshooting Guide: SQL Server Error 3750

Why This Error Happens

This warning occurs because SQL Server automatically disables all nonclustered indexes on a table when the underlying clustered index is disabled, since nonclustered indexes rely on the clustered index’s row locators (the clustering key) to function correctly. This typically happens after a schema change, a failed index rebuild operation, or when an administrator intentionally runs an ALTER INDEX ... DISABLE command on the clustered index without accounting for dependent indexes. Until the clustered index is rebuilt, the table and all its nonclustered indexes remain inaccessible for standard query operations.

Step-by-Step Resolution Guide

Step 1: Identify the Affected Table and Indexes

  • Open SQL Server Management Studio (SSMS) and connect to the SQL Server 2025 instance.
  • Run the following query to find all disabled indexes:
SELECT name, object_id, index_id, type_desc, is_disabled 
FROM sys.indexes 
WHERE is_disabled = 1;
  • Note the table name and clustered index name referenced in the Error 3750 message.

Step 2: Rebuild the Clustered Index

  • Execute a rebuild command on the clustered index identified in Step 1. This will restore the table’s data structure and bring the base table back online.
ALTER INDEX [ClusteredIndexName] ON [SchemaName].[TableName] REBUILD;
  • Ensure you have sufficient disk space in the database’s data file path (typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\) as a rebuild requires temporary space equal to the size of the index.

Step 3: Rebuild the Dependent Nonclustered Indexes

  • Rebuilding the clustered index does not automatically re-enable the nonclustered indexes; they must be rebuilt individually.
  • Run the following command for every nonclustered index flagged in the initial query:
ALTER INDEX [NonClusteredIndexName] ON [SchemaName].[TableName] REBUILD;
  • Alternatively, rebuild all indexes on the table simultaneously using the ALL keyword:
ALTER INDEX ALL ON [SchemaName].[TableName] REBUILD;

Step 4: Check Job History for the Root Cause

  • Navigate to SQL Server Agent > Jobs in SSMS to review the history of any maintenance plans that might have triggered the disable action.
  • Look for failed “Index Maintenance” or “Rebuild” jobs in the Windows Event Viewer under Applications and Services Logs > MSSQLSERVER to prevent the disable event from recurring.

Alternative or Verification Steps

  • Verify the Fix: Re-run the sys.indexes query from Step 1; the is_disabled column should now return 0 for all previously affected rows, and the table should be queryable via a simple SELECT TOP 10 * FROM [TableName].
  • Alternative Fix: If a rebuild fails due to insufficient disk space, use ALTER INDEX [ClusteredIndexName] ON [TableName] REBUILD WITH (ONLINE = ON) (Enterprise Edition only) to minimize locking, or drop and recreate the index manually using CREATE CLUSTERED INDEX if the disable state persists.

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

Troubleshooting Guide: Error 3748 – Cannot Drop Non-Clustered Index Using DROP CLUSTERED INDEX Clause

Why This Error Happens

This error occurs when a DROP INDEX statement explicitly specifies the WITH DROP CLUSTERED INDEX clause (or targets the index via a clustered-index-specific syntax path) against an index that SQL Server’s metadata identifies as non-clustered. SQL Server 2025 strictly validates the index type in sys.indexes against the command syntax before execution, and a mismatch—often caused by a schema change, an index rebuild that altered the index type, or a copy-pasted script written for a different table—triggers this validation failure. It can also surface after a failed or partial index migration where the original clustered index was dropped and recreated as non-clustered, but maintenance scripts were not updated to reflect the change.

Step-by-Step Resolution Guide

Step 1: Verify the Actual Index Type in Metadata

  • Open SQL Server Management Studio (SSMS) 21 or Azure Data Studio connected to your SQL Server 2025 instance.
  • Run the following query to confirm the index type before taking action:
SELECT name, type, type_desc, is_primary_key, is_unique
FROM sys.indexes
WHERE object_id = OBJECT_ID('YourSchema.YourTableName');
  • Confirm whether type_desc returns NONCLUSTERED instead of the expected CLUSTERED value.

Step 2: Correct the DROP INDEX Syntax

  • Rewrite the DROP INDEX command to match the correct index type instead of forcing the clustered clause.
  • For a non-clustered index, use the standard syntax without the clustered-specific option:
DROP INDEX [YourIndexName] ON [YourSchema].[YourTableName];
  • Avoid using WITH DROP CLUSTERED INDEX unless sys.indexes explicitly confirms type = 1 (clustered).

Step 3: Update Automated Scripts and Maintenance Plans

  • Check SQL Server Agent Jobs, Ola Hallengren maintenance scripts, or DevOps deployment pipelines (Azure DevOps/GitHub Actions YAML) for hardcoded clustered index drop logic.
  • Open the relevant .sql deployment file located typically in C:\Scripts\SQLMaintenance\ or your CI/CD repository artifact folder.
  • Replace any conditional logic that assumes a static index type with a dynamic check using the sys.indexes query from Step 1.

Step 4: Rebuild or Recreate the Index Correctly

  • If the goal was to convert a non-clustered index to clustered, drop the non-clustered index first using correct syntax, then create the clustered index explicitly:
CREATE CLUSTERED INDEX [IX_YourTable_Clustered]
ON [YourSchema].[YourTableName] ([YourColumnName]);
  • Ensure no other clustered index already exists on the table, as SQL Server only permits one clustered index per table.

Alternative or Verification Steps

  • Re-run the sys.indexes query from Step 1 after executing the corrected DROP INDEX or CREATE INDEX statement to confirm the type_desc field now matches your intended index structure.
  • If the error persists in an automated pipeline, add a pre-execution validation step using IF EXISTS (SELECT 1 FROM sys.indexes WHERE type = 1 ...) to dynamically branch the script logic instead of hardcoding the clustered clause.

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

Troubleshooting Guide: Error 3747 — Cannot Drop Clustered Index Created on a View

Why This Error Happens

This error occurs because SQL Server does not allow a clustered index on an indexed view to be removed using the standard DROP INDEX or DROP CLUSTERED INDEX clause in the same way it would for a table. Indexed views rely on their clustered index as the mechanism that materializes and physically stores the result set, so SQL Server treats the drop operation differently to prevent orphaning the view’s underlying data structure. The error is essentially a syntax/method restriction rather than a permissions or corruption issue — the engine is blocking an unsupported command path, not reporting a system failure.

Step-by-Step Resolution Guide

Step 1: Confirm the Index Is Tied to a View, Not a Table

  • Run the following query to verify the object type:
  • SELECT o.type_desc, i.name AS index_name FROM sys.indexes i JOIN sys.objects o ON i.object_id = o.object_id WHERE i.name = 'YourIndexName';
  • If type_desc returns VIEW, this confirms Error 3747 is expected behavior, not a bug.

Step 2: Use the Correct Drop Syntax for Indexed Views

  • Instead of DROP CLUSTERED INDEX index_name ON view_name, use the fully qualified two-part index drop syntax:
  • DROP INDEX index_name ON schema_name.view_name;
  • Ensure you reference the schema explicitly, as unqualified view names can cause resolution errors in SQL Server 2025.

Step 3: Drop the Entire View If a Full Rebuild Is Needed

  • If you need to remove all indexing (not just the clustered index) because the view structure is changing:
  • DROP VIEW schema_name.view_name;
  • Recreate the view with CREATE VIEW ... WITH SCHEMABINDING and then reapply CREATE UNIQUE CLUSTERED INDEX as a fresh object.

Step 4: Check for Dependent Nonclustered Indexes First

  • Indexed views often have nonclustered indexes layered on top of the clustered index.
  • Drop all dependent nonclustered indexes before attempting to drop the clustered index:
  • DROP INDEX nonclustered_index_name ON schema_name.view_name;
  • Only after dependents are removed should you proceed to drop the clustered index using the Step 2 syntax.

Step 5: Validate Permissions and Schema Binding Locks

  • Confirm your login has ALTER permission on the schema and CONTROL permission on the view.
  • Check for active schema-bound dependencies using:
  • SELECT * FROM sys.sql_expression_dependencies WHERE referenced_entity_name = 'view_name';
  • Remove or temporarily disable schema binding dependencies blocking the drop operation.

Alternative or Verification Steps

  • Verify the fix by re-running sys.indexes against the view object — the clustered index entry should no longer appear once successfully dropped.
  • If the error persists, use SQL Server Management Studio’s Object Explorer to right-click the index under the view node and select Delete, which internally issues the correct syntax and bypasses manual command errors.

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

Troubleshooting Guide: Error 3746 – Cannot Drop Clustered Index on Replicated View

Why This Error Happens

This error occurs because the indexed view you are attempting to modify is currently referenced as an article in one or more active replication publications (snapshot, transactional, or merge). SQL Server 2025 protects the clustered index of indexed views used in replication because removing it would break the schema synchronization mechanism that replication relies on to track and distribute data changes. Until the view is explicitly removed from the publication or replication is temporarily disabled, the engine will block any DDL operation that attempts to drop this index.

Step-by-Step Resolution Guide

Step 1: Identify the Publication Using the View

  • Open SQL Server Management Studio (SSMS) and connect to the instance running on Windows Server 2025.
  • Run the following query to confirm the view is part of a publication:
  SELECT * FROM sys.syspublications;
  SELECT * FROM sys.sysarticles WHERE name = 'YourViewName';
  • Note the publication name and article ID associated with the view.

Step 2: Remove the View as an Article from Replication

  • Open the Replication Monitor or use Transact-SQL to drop the article from the publication:
  EXEC sp_droparticle 
      @publication = 'YourPublicationName', 
      @article = 'YourViewName';
  • If using Merge Replication, use sp_dropmergearticle instead.
  • Confirm no subscribers are still pulling data from this article before removing it.

Step 3: Drop the Clustered Index on the View

  • Once the article is removed from replication, re-attempt the DDL operation:
  DROP INDEX YourIndexName ON dbo.YourViewName;
  • Verify no error 3746 is returned in the Messages pane of SSMS.

Step 4: Re-Add the View to Replication (If Required)

  • If the view needs to remain part of replication after index changes, recreate the clustered index first:
  CREATE UNIQUE CLUSTERED INDEX YourIndexName 
  ON dbo.YourViewName (YourColumn);
  • Then re-add the article using sp_addarticle and re-initialize the subscription if necessary.

Step 5: Restart Replication Agents

  • Open SQL Server Configuration Manager on Windows Server 2025 and restart the SQL Server Agent service.
  • Confirm the Log Reader Agent and Snapshot Agent jobs complete successfully in Replication Monitor.

Alternative or Verification Steps

  • Verify the fix by querying sys.indexes and sys.sysarticles to confirm the index exists and the view is correctly reassociated with replication (if re-added).
  • As an alternative, if removing the article is not feasible, temporarily disable replication for the publication using sp_replicationdboption with @optname = 'publish' set to false, perform the index change, then re-enable replication.

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

Troubleshooting Guide: SQL Server Error 3745 – “Only a Clustered Index Can Be Dropped Online”

Why This Error Happens

This error occurs when a DROP INDEX statement is executed with the ONLINE = ON option against a nonclustered index, which SQL Server 2025 does not support for online drop operations. The root cause is almost always a T-SQL script or ORM-generated migration that applies the WITH (ONLINE = ON) clause universally without checking the index type first. This can also surface in automated deployment pipelines where index-maintenance scripts were written for a different index configuration than what currently exists on the target table.

Step-by-Step Resolution Guide

Step 1: Identify the Index Type Causing the Conflict

  • Run the following query to check whether the target index is clustered or nonclustered:
  SELECT name, type_desc, is_primary_key, is_unique_constraint
  FROM sys.indexes
  WHERE object_id = OBJECT_ID('YourSchema.YourTableName');
  • Confirm that type_desc returns NONCLUSTERED — this confirms the ONLINE = ON clause is invalid for this specific drop operation.

Step 2: Modify the DROP INDEX Statement

  • Remove the ONLINE = ON option from the script for nonclustered indexes:
  DROP INDEX YourIndexName ON YourSchema.YourTableName
  WITH (ONLINE = OFF);
  • If using SQL Server Management Studio (SSMS) 21 (compatible with SQL Server 2025), check the “Generate Script” options under Index Properties > Options and ensure “Online” is unchecked before scripting the drop operation.

Step 3: Audit Deployment Scripts and ORM Migrations

  • Search your migration files (e.g., Entity Framework, Liquibase, Flyway) located typically in C:\Projects\YourApp\Migrations\ or equivalent repository folders.
  • Locate and remove hardcoded ONLINE = ON flags applied indiscriminately to all DROP INDEX commands.
  • If the application dynamically builds DDL, add a conditional check against sys.indexes.type_desc before appending the ONLINE clause.

Step 4: Rebuild the Script Using SQL Server 2025 Compatibility

  • If the issue stems from legacy scripts written for older SQL Server versions, regenerate the index maintenance script using the Database Engine Tuning Advisor or SSMS’s native scripting wizard, ensuring compatibility level 170 (SQL Server 2025) is selected in Database Properties > Options.
  • Re-run the corrected script in a staging environment before deploying to production.

Alternative or Verification Steps

  • Verify the fix by re-executing the corrected DROP INDEX statement and confirming no Error 3745 is returned; check sys.indexes again to confirm the index no longer exists.
  • As an alternative, if online operations are required, drop the index without the ONLINE clause during a scheduled maintenance window, or rebuild it as part of an ALTER INDEX ... REBUILD WITH (ONLINE = ON) operation instead of a standalone drop.

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

Troubleshooting Guide: Error 3743 – Database Mirroring Must Be Removed Before Dropping Database

Why This Error Happens

This error occurs because SQL Server 2025 blocks the DROP DATABASE command when the target database is still configured as a principal or mirror in a database mirroring session. The mirroring metadata and endpoint relationship remain active in the system catalog, which prevents the storage engine from safely releasing the database’s files and transaction log. Until the mirroring partnership is explicitly terminated, SQL Server treats the database as part of a high-availability topology and refuses the drop to avoid orphaning the mirror partner or witness server.

Step-by-Step Resolution Guide

Step 1: Verify the Current Mirroring State

  • Open SQL Server Management Studio (SSMS) and connect to the principal server instance.
  • Run the following query to confirm mirroring status:
  SELECT name, mirroring_state_desc, mirroring_role_desc 
  FROM sys.database_mirroring 
  WHERE database_id = DB_ID('YourDatabaseName');
  • Confirm whether the database is acting as a PRINCIPAL or MIRROR, as this determines which server you must run the removal command on.

Step 2: Remove the Database Mirroring Partnership

  • On the principal server instance, execute the following T-SQL command to break the mirroring session:
  ALTER DATABASE [YourDatabaseName] SET PARTNER OFF;
  • If a witness server is configured, ensure it is reachable; otherwise, use ALTER DATABASE ... SET PARTNER OFF directly from the principal, as this command does not require the witness to respond.
  • Wait a few seconds and re-run the query from Step 1 to confirm mirroring_state_desc now returns NULL, indicating mirroring has been fully disabled.

Step 3: Clean Up Endpoints (If Applicable)

  • Navigate to Object Explorer > Server Objects > Endpoints in SSMS on both the former principal and mirror instances.
  • If the mirroring endpoint (typically named Mirroring on TCP port 5022) is no longer needed for other databases, remove it using:
  DROP ENDPOINT [Mirroring];
  • Skip this step if the endpoint is shared with other mirrored databases on the same instance.

Step 4: Drop the Database

  • With mirroring fully removed, execute the standard drop command:
  DROP DATABASE [YourDatabaseName];
  • If the command still fails, check for active connections using sp_who2 and set the database to single-user mode first:
  ALTER DATABASE [YourDatabaseName] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  DROP DATABASE [YourDatabaseName];

Alternative or Verification Steps

  • Verify Success: Re-query sys.databases to confirm the database no longer appears in the list: SELECT name FROM sys.databases WHERE name = 'YourDatabaseName'; (should return zero rows).
  • Alternative Fix: If SET PARTNER OFF fails due to a broken network link to the mirror, force the removal using ALTER DATABASE [YourDatabaseName] SET PARTNER OFF; directly on the mirror server if it is still accessible, or restore the database from a backup on a clean instance and drop it there instead.

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

Troubleshooting Guide: SQL Server Error 3744 — “Only a Single Clause Is Allowed in a Statement Where an Index Is Dropped Online”

Why This Error Happens

This error occurs when a DROP INDEX statement using the WITH (ONLINE = ON) option attempts to drop multiple indexes in a single statement. SQL Server 2025 requires that online index drop operations target exactly one index per statement because the online rebuild/drop mechanism needs to manage schema locks and row-versioning for a single object at a time. When a multi-clause syntax (e.g., DROP INDEX idx1 ON table1, idx2 ON table2 WITH (ONLINE = ON)) is submitted, the query optimizer rejects it outright since it cannot safely parallelize or sequence the online metadata changes for multiple indexes in one atomic batch.

Step-by-Step Resolution Guide

Step 1: Identify the Offending T-SQL Statement

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio and locate the script or stored procedure that threw Error 3744.
  • Check the query text in the error details pane or SQL Server Error Log at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Look specifically for DROP INDEX statements containing comma-separated index names combined with WITH (ONLINE = ON).

Step 2: Split the Multi-Index Drop Statement

  • Rewrite the statement so each index drop is its own standalone command.
  • Example fix:
  DROP INDEX idx1 ON dbo.table1 WITH (ONLINE = ON);
  DROP INDEX idx2 ON dbo.table2 WITH (ONLINE = ON);
  • Ensure each statement ends with a semicolon and is executed sequentially, not batched into a single DROP INDEX call.

Step 3: Update Automation Scripts or ORM-Generated Code

  • Search deployment pipelines, DACPAC scripts, or migration tools (e.g., Entity Framework, Flyway, Redgate) for auto-generated multi-clause DROP INDEX syntax.
  • Modify the script templates so each index drop online command is generated as a separate T-SQL batch (GO separator if using SSMS scripts).
  • Re-deploy or re-run the corrected script against the target database.

Step 4: Adjust for Concurrency if Dropping Many Indexes

  • If dropping several indexes online is a frequent task, wrap each DROP INDEX ... WITH (ONLINE = ON) call in a loop using dynamic SQL within a stored procedure.
  • Example:
  DECLARE @sql NVARCHAR(MAX);
  SELECT @sql = STRING_AGG(
      'DROP INDEX ' + name + ' ON dbo.table1 WITH (ONLINE = ON);', CHAR(13)
  ) FROM sys.indexes WHERE object_id = OBJECT_ID('dbo.table1') AND name IN ('idx1','idx2');
  EXEC sp_executesql @sql;
  • This ensures each drop still executes as its own isolated online operation while automating the batch process.

Alternative or Verification Steps

  • After applying the fix, re-run the corrected scripts and confirm no Error 3744 appears in the SQL Server Error Log or SSMS Messages tab.
  • If online index drops are not critical for your workload, use WITH (ONLINE = OFF) (default) to drop multiple indexes in a single statement as a quick workaround, though this will briefly lock the table.

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

Troubleshooting Guide: Error 3741 – Cannot Drop Table Due to Offline Filegroup

Why This Error Happens

This error occurs when SQL Server 2025 attempts to drop a table or index, but part of the underlying data (such as a partition, text/image data, or an index) resides on a filegroup that is currently marked OFFLINE. SQL Server requires all data pages associated with an object to be accessible in order to properly deallocate space and remove metadata during a DROP operation. This typically happens after a filegroup’s underlying disk fails, a database file is moved/deleted outside of SQL Server, or a piecemeal restore has not yet brought all filegroups online.

Step-by-Step Resolution Guide

Step 1: Identify the Offline Filegroup

  • Open SQL Server Management Studio (SSMS) and connect to the instance.
  • Run the following query to identify the status of all filegroups and files:
SELECT name, state_desc, physical_name 
FROM sys.master_files 
WHERE database_id = DB_ID('YourDatabaseName');
  • Look specifically for state_desc values showing OFFLINE or RECOVERY_PENDING.

Step 2: Verify Physical File Location and Disk Health

  • Navigate to the physical path listed in the query (e.g., C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\).
  • Confirm the .ndf or .mdf file actually exists at that location.
  • Check Windows Server 2025 Disk Management or Event Viewer for underlying storage/disk errors that may have caused the volume to dismount.
  • If the file was moved, copy it back to the original path referenced in sys.master_files.

Step 3: Bring the Filegroup Back Online

  • If the physical file is intact and accessible, attempt to bring the file back online using T-SQL:
ALTER DATABASE YourDatabaseName MODIFY FILE 
(NAME = YourLogicalFileName, FILENAME = 'C:\Path\To\File.ndf');

ALTER DATABASE YourDatabaseName SET ONLINE;
  • If the file is missing or corrupted, restore the specific filegroup from the last valid backup using a piecemeal restore strategy:
RESTORE DATABASE YourDatabaseName 
FILEGROUP = 'YourFilegroupName' 
FROM DISK = 'C:\Backups\YourBackupFile.bak' 
WITH NORECOVERY;

Step 4: Retry the Drop Operation

  • Once the filegroup status reads ONLINE in sys.master_files, retry the original DROP TABLE or DROP INDEX command.
  • If the table data has been fully recovered, the operation should now complete without raising Error 3741.

Alternative or Verification Steps

  • Verify the Fix: Re-run the sys.master_files query from Step 1; ensure the state_desc column reads ONLINE for all files associated with the database before attempting further schema changes.
  • Alternative Solution: If the filegroup cannot be recovered (e.g., due to permanent hardware failure and no backup availability), you must use DBCC CHECKDB with the REPAIR_ALLOW_DATA_LOSS option as a last resort, understanding that this will remove the corrupted data pages to allow the table structure to be dropped.

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

Troubleshooting Guide: Error 3740 – Cannot Drop Object on Read-Only Filegroup

Why This Error Happens

This error occurs because the table, index, or object you are attempting to drop has pages physically residing on a filegroup that is currently marked as READ-ONLY. SQL Server 2025 requires write access to the filegroup to update system metadata and reclaim space during a DROP TABLE or DROP INDEX operation, so it blocks the action to prevent corruption. This is commonly seen on archival databases, SAN-replicated volumes, or databases restored from read-only backups where the PRIMARY or secondary filegroup property was not reset after migration.

Step-by-Step Resolution Guide

Step 1: Identify the Affected Filegroup

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio and connect to the instance.
  • Run the following query to identify which filegroup is read-only:
  SELECT name, is_read_only FROM sys.filegroups;
  • Note the specific name of the filegroup returned with is_read_only = 1.

Step 2: Verify File System Permissions (Windows Server 2025 / Windows 11)

  • Navigate to the physical data file location (e.g., C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\).
  • Right-click the .ndf or .mdf file associated with the filegroup and select Properties.
  • Ensure the Read-only attribute checkbox under the General tab is unchecked.
  • Confirm the NT SERVICE\MSSQLSERVER account has Modify permissions under the Security tab.

Step 3: Alter the Filegroup to Read-Write

  • Execute the following T-SQL command to change the database state, replacing YourDatabaseName and YourFilegroupName with your specific values:
  ALTER DATABASE YourDatabaseName 
  MODIFY FILEGROUP YourFilegroupName READWRITE;
  • If the database is part of an Availability Group (AG) in SQL Server 2025, ensure you run this command on the Primary Replica only.

Step 4: Retry the Drop Operation

  • Once the filegroup status is updated, immediately re-run your original DROP TABLE or DROP INDEX command.
  • If the object drop succeeds without the 3740 error, proceed to revert the filegroup to read-only (if required for compliance) using ALTER DATABASE ... MODIFY FILEGROUP ... READONLY;.

Alternative or Verification Steps

  • Verification: Re-run the sys.filegroups query from Step 1. The is_read_only column should now show 0 for the target filegroup, and the DROP command should execute without throwing Error 3740.
  • Alternative: If you cannot change the filegroup to read-write (e.g., due to SAN snapshot locks), you may need to export the required data to a new table located on the PRIMARY filegroup and drop the entire read-only filegroup instead of the single object.

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

Troubleshooting Guide: Error 3739 in SQL Server 2025

Why This Error Happens

Error 3739 occurs when a Transact-SQL statement attempts to perform a statistics-only operation (such as UPDATE STATISTICS or DROP STATISTICS) against an object that is actually a regular index rather than a standalone statistics collection. This typically happens due to a naming ambiguity or scripting error where an index name is passed into a command path expecting a statistics object name. It can also surface after an automated maintenance script or third-party tool incorrectly enumerates sys.stats alongside sys.indexes, blurring the distinction between the two object types.

Step-by-Step Resolution Guide

Step 1: Identify the Object Type Causing the Conflict

  • Run the following query to determine if the name in the error message belongs to an index or a statistics object:
SELECT name, object_id, type_desc 
FROM sys.indexes 
WHERE name = 'YourObjectName';

SELECT name, object_id, stats_id 
FROM sys.stats 
WHERE name = 'YourObjectName';
  • Confirm whether the object has an index_id greater than 0 (indicating a true index) versus an entry only in sys.stats with no corresponding index.

Step 2: Correct the Maintenance Script or Query

  • Locate the maintenance plan, Agent Job step, or PowerShell/DBATools script issuing the failing command.
  • Replace generic enumeration logic (e.g., looping through sys.stats without filtering) with a filter that excludes auto-created index statistics:
SELECT s.name 
FROM sys.stats s
WHERE s.auto_created = 0 
AND s.user_created = 1;
  • Update any sp_updatestats or custom UPDATE STATISTICS calls to target the index directly using ALTER INDEX ... REBUILD or UPDATE STATISTICS <table> <index_name> syntax instead of a bare statistics name.

Step 3: Validate Index and Statistics Integrity

  • Open SQL Server Management Studio (SSMS) on Windows Server 2025 or Windows 11 and connect to the instance.
  • Navigate to Databases > [YourDB] > Tables > [YourTable] > Indexes and confirm the object in question is listed as an index, not under Statistics.
  • If corruption or metadata mismatch is suspected, run:
DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for any metadata inconsistencies tied to sys.indexes or sys.stats and repair using DBCC CHECKDB with the appropriate repair option if corruption is confirmed.

Step 4: Re-run the Original Operation

  • Re-execute the original DROP STATISTICS, UPDATE STATISTICS, or maintenance job using the corrected object reference.
  • Monitor the SQL Server Error Log (via SSMS Object Explorer > Management > SQL Server Logs) to confirm Error 3739 no longer appears.

Alternative or Verification Steps

  • Verify the fix by querying sys.stats and sys.indexes again post-fix to ensure the script now correctly differentiates object types before executing statistics commands.
  • As an alternative, if the issue stems from a third-party backup or indexing tool, check for a vendor patch compatible with SQL Server 2025, since many legacy tools have not yet updated their internal catalog queries for the new engine version.

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

Troubleshooting Guide: SQL Server Error 3738 — “Deleting database file ‘%ls'”

Why This Error Happens

Error 3738 is typically an informational message logged during a DBCC SHRINKFILE operation with the EMPTYFILE option, indicating SQL Server is in the process of removing an empty database file. However, when this message appears unexpectedly or the deletion stalls, it usually points to the file not being fully empty (residual data pages not migrated), the file being referenced by active transactions, or insufficient permissions on the underlying filesystem path preventing SQL Server’s service account from completing the physical file removal. In rarer cases, filesystem-level locks (antivirus, backup agents) or storage corruption on Windows Server 2025 volumes can prevent the final handle release needed to delete the file.

Step-by-Step Resolution Guide

Step 1: Confirm the File Is Actually Empty

  • Run DBCC SHRINKFILE (N'logical_file_name', EMPTYFILE); again to ensure all data pages were migrated out successfully.
  • Query sys.dm_db_file_space_usage to verify zero allocated extents remain in the target file.
  • If pages remain, check for LOB/text columns or indexes that didn’t shrink cleanly; rebuild indexes with ALTER INDEX ALL ON [table] REBUILD; first.

Step 2: Check for Active Transactions or Open Handles

  • Query sys.dm_tran_active_transactions and sys.dm_exec_sessions to confirm no open transactions are referencing the database.
  • Use sp_who2 or sys.dm_exec_requests to identify blocking sessions tied to the database ID.
  • On Windows Server 2025/Windows 11, use Resource Monitor (resmon.exe) or handle.exe (Sysinternals) to check if an external process (antivirus, backup software) has a lock on the .mdf/.ndf file.

Step 3: Verify Service Account Permissions on the File Path

  • Confirm the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control on the data folder, typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\.
  • Right-click the folder → Properties → Security tab → verify/add the service account with Modify/Full Control permissions.
  • Restart the SQL Server service via services.msc or Restart-Service MSSQLSERVER (PowerShell, run as Administrator) after permission changes.

Step 4: Manually Remove the File from the Database Metadata

  • If the file is logically empty but SQL Server still can’t drop it, run:
  ALTER DATABASE [YourDB] REMOVE FILE logical_file_name;
  • Check sys.master_files to confirm the file entry no longer exists after the command completes.

Step 5: Exclude SQL Server Data Directories from Antivirus/Backup Scans

  • Add exclusions in Windows Defender (or third-party AV) for the DATA and LOG folders under the SQL Server instance path.
  • Pause any VSS-based backup agents temporarily and retry the shrink/remove operation to rule out file-locking conflicts.

Alternative or Verification Steps

  • Verify success by querying sys.master_files — the removed file should no longer appear, and the physical .ndf/.mdf file should be gone from the filesystem.
  • If the issue persists, take the database offline (ALTER DATABASE [YourDB] SET OFFLINE;), manually delete the file via File Explorer (if unlocked), then bring the database back online (ALTER DATABASE [YourDB] SET ONLINE;) to force cleanup.

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

Troubleshooting Guide: Error 3736 – Cannot Drop Object Used for Distribution

Why This Error Happens

This error occurs when an attempt is made to drop a database, table, stored procedure, or other object that is currently registered as an article or is otherwise referenced within SQL Server’s replication distribution system. SQL Server 2025 blocks the drop operation to prevent orphaned metadata in the distribution database, which tracks publications, subscriptions, and transaction log dependencies. This typically happens because replication was not properly unconfigured before the drop command was issued, leaving active links between the object and the distribution database.

Step-by-Step Resolution Guide

Step 1: Identify Active Replication Dependencies

  • Open SQL Server Management Studio (SSMS) and connect to the instance reporting the error.
  • Run the following query against the distribution database to locate the offending object:
USE distribution;
SELECT * FROM MSarticles WHERE article = 'YourObjectName';
  • Cross-check results against MSpublications and MSsubscriptions tables to confirm the object’s role in replication.

Step 2: Remove the Object from Replication Configuration

  • Navigate to Replication > Local Publications in SSMS Object Explorer.
  • If the object is an article within a publication, right-click the publication and select Properties > Articles, then uncheck or remove the specific article.
  • Alternatively, run the system stored procedure to drop the article cleanly:
EXEC sp_dropsubscription @publication = 'PubName', @article = 'ArticleName', @subscriber = 'all';
EXEC sp_droparticle @publication = 'PubName', @article = 'ArticleName';

Step 3: Disable Publishing/Distribution (If Object is No Longer Needed)

  • If replication itself is being decommissioned, launch the Disable Publishing and Distribution Wizard via right-click on the Replication node in SSMS.
  • On Windows Server 2025, ensure the SQL Server Agent service (SQLSERVERAGENT) is running, as replication cleanup jobs rely on it.
  • Confirm no distribution agents are actively pushing transactions by checking Replication Monitor.

Step 4: Retry the Drop Command

  • Once the article/publication references are removed, attempt the original DROP TABLE, DROP PROCEDURE, or DROP DATABASE command again.
  • If dropping a database, ensure it is not still flagged as a Publisher or Distributor via:
EXEC sp_helpdistpublisher;

Alternative or Verification Steps

  • Verify the fix: Re-run SELECT * FROM distribution.dbo.MSarticles WHERE article = 'YourObjectName'; — the query should return zero rows, confirming the object is no longer tracked by replication.
  • Alternative fallback: If the object remains locked due to orphaned metadata, use sp_removedbreplication 'YourDatabaseName' to forcibly strip all replication settings from the database, then retry the drop operation.

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

Troubleshooting Guide: SQL Server Error 3737 — “Could not delete file ‘%ls'”

Why This Error Happens

This error typically occurs during a database backup, restore, or file removal operation (such as DBCC SHRINKFILE with EMPTYFILE, or dropping a database) when SQL Server’s service account lacks sufficient NTFS permissions on the target file or folder. It can also happen if the file is locked by another process (antivirus scanners, backup agents, or a lingering SQL Server handle), is marked read-only, or resides on a volume/path that no longer exists or is inaccessible due to storage misconfiguration. Less commonly, file system corruption or an improperly dismounted volume prevents the delete operation from completing.

Step-by-Step Resolution Guide

Step 1: Verify File and Folder Permissions

  • Locate the exact file path referenced in the error (check the SQL Server Error Log at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for the full %ls value).
  • Right-click the file/folder, go to Properties > Security, and confirm the SQL Server service account (e.g., NT Service\MSSQLSERVER or a custom domain account) has Full Control.
  • Grant permissions via PowerShell if needed:
  icacls "D:\SQLData\YourFile.mdf" /grant "NT SERVICE\MSSQLSERVER:(F)"

Step 2: Check for File Locks and Exclude from Antivirus

  • Use Process Explorer (Sysinternals) or openfiles /query to identify if another process has an open handle on the file.
  • Add SQL Server data/log directories to your antivirus and Windows Defender exclusion list to prevent real-time scanning from locking files:
  Add-MpPreference -ExclusionPath "D:\SQLData"
  Add-MpPreference -ExclusionPath "D:\SQLLogs"
  • Stop any third-party backup agents temporarily and retry the operation.

Step 3: Confirm the Path Exists and Is Writable

  • Verify the drive/volume referenced in the error is online using Disk Management or Get-Disk in PowerShell.
  • Ensure the file is not flagged as read-only:
  attrib -R "D:\SQLData\YourFile.ndf"
  • If the volume uses storage spaces or a SAN/NAS mount, confirm connectivity and that the drive letter/mount point hasn’t changed.

Step 4: Restart SQL Server Service to Release Stale Handles

  • Open SQL Server Configuration Manager, right-click the SQL Server (MSSQLSERVER) service, and select Restart.
  • This clears any orphaned internal file handles that may be causing the delete to fail silently.
  • Re-run the operation (e.g., DBCC SHRINKFILE, DROP DATABASE, or backup job) immediately after restart.

Alternative or Verification Steps

  • Re-run the original command (e.g., ALTER DATABASE ... REMOVE FILE or DROP DATABASE) and check the Error Log to confirm Error 3737 no longer appears.
  • If the issue persists, manually delete the file via File Explorer or del command after taking the database offline, then run DBCC CHECKDB to confirm no orphaned references remain in the system catalog.

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

Troubleshooting Guide: SQL Server Error 3735 – Primary Key Constraint Cannot Be Dropped

Why This Error Happens

This error occurs because the table has Change Tracking enabled, which has a hard dependency on the primary key constraint to track row-level changes (INSERT, UPDATE, DELETE) via the key values. SQL Server 2025 blocks the ALTER TABLE ... DROP CONSTRAINT operation to prevent an orphaned change tracking configuration that would have no way to identify rows. This is a protective mechanism, not a corruption or permissions issue—it is purely a sequencing/dependency violation in the DDL operation order.

Step-by-Step Resolution Guide

Step 1: Identify Which Tables Have Change Tracking Enabled

  • Run the following query to confirm change tracking status on the target table:
SELECT t.name AS TableName, ct.is_track_columns_updated_on
FROM sys.change_tracking_tables ct
JOIN sys.tables t ON ct.object_id = t.object_id
WHERE t.name = 'YourTableName';
  • If a row is returned, change tracking is active and is the direct cause of Error 3735.

Step 2: Disable Change Tracking on the Table

  • Execute the following T-SQL command in SQL Server Management Studio (SSMS) or Azure Data Studio, scoped to the correct database context:
USE YourDatabaseName;
GO
ALTER TABLE dbo.YourTableName DISABLE CHANGE_TRACKING;
  • Ensure you are running this with db_owner or ALTER permissions on the table.
  • If change tracking is enabled at the database level only (not table level), you may also need to check sys.change_tracking_databases.

Step 3: Drop the Primary Key Constraint

  • Once change tracking is disabled, retry the original operation:
ALTER TABLE dbo.YourTableName DROP CONSTRAINT PK_YourTableName;
  • This should now complete without raising Error 3735.

Step 4: Re-enable Change Tracking (If Required)

  • If your application logic depends on change tracking, re-create the primary key first, then re-enable tracking:
ALTER TABLE dbo.YourTableName ADD CONSTRAINT PK_YourTableName PRIMARY KEY (YourColumn);
GO
ALTER TABLE dbo.YourTableName ENABLE CHANGE_TRACKING;
  • Confirm the new primary key column(s) align with your application’s change tracking consumer logic (e.g., CDC clients, sync frameworks).

Alternative or Verification Steps

  • Verify the fix by re-running the sys.change_tracking_tables query from Step 1 — it should return no rows if tracking was successfully disabled, or return the new configuration if re-enabled.
  • If you cannot disable change tracking due to active application dependencies (e.g., Azure Mobile Apps sync), consider scheduling the constraint change during a maintenance window and temporarily pausing sync clients to avoid data loss.

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

Troubleshooting Guide: Error 3734 – Could Not Drop Primary Key Constraint Due to XML or Spatial Index

Why This Error Happens

This error occurs because SQL Server 2025 does not allow a primary key constraint to be dropped while a dependent XML or spatial index still exists on that table, since these index types are physically built on top of the clustering key defined by the primary key. The dependency is enforced at the engine level to prevent orphaned or corrupted index structures, meaning the drop operation is blocked until the dependent objects are removed. This typically happens when a DBA attempts a schema change (like altering the primary key) without first auditing all index dependencies on the table.

Step-by-Step Resolution Guide

Step 1: Identify Dependent XML and Spatial Indexes

  • Open SQL Server Management Studio (SSMS) and connect to the target instance.
  • Run the following query to find dependent indexes on the specific table:
  SELECT i.name AS IndexName, i.type_desc 
  FROM sys.indexes i 
  WHERE i.object_id = OBJECT_ID('YourSchema.YourTableName') 
  AND i.type_desc IN ('XML', 'SPATIAL');
  • Note down the exact names of these indexes for the next step.

Step 2: Script and Drop the Dependent Indexes

  • Before dropping, right-click each index in SSMS and select “Script Index as DROP To” to save a backup script for recreation later.
  • Execute the drop command for every XML or Spatial index found in Step 1:
  DROP INDEX IndexName ON YourSchema.YourTableName;
  • Repeat this process until no XML or Spatial indexes remain linked to the primary key.

Step 3: Drop and Recreate the Primary Key Constraint

  • With the dependencies cleared, execute your original command to drop the primary key:
  ALTER TABLE YourSchema.YourTableName DROP CONSTRAINT YourPrimaryKeyName;
  • If you need to add a new primary key or modify the clustered index, do so now using the ALTER TABLE ... ADD CONSTRAINT syntax.

Step 4: Recreate the XML or Spatial Indexes

  • Using the scripts saved in Step 2, recreate the XML or Spatial indexes on the table.
  • Ensure the underlying columns and data types remain compatible with the index type (e.g., geometry or geography for spatial, xml for XML indexes).

Alternative or Verification Steps

  • Verification: Run sp_helpindex 'YourTableName' or query sys.indexes again to confirm the primary key constraint was successfully altered and that the XML/Spatial indexes have been rebuilt correctly.
  • Alternative: If recreating the index immediately is not feasible due to maintenance windows, consider using DROP_EXISTING = ON in your index creation syntax to streamline the rebuild process once the schema change is complete.

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

Troubleshooting Guide: Error 3733 – Constraint Does Not Belong to Table

Why This Error Happens

This error occurs when a Transact-SQL statement, typically ALTER TABLE...DROP CONSTRAINT or a related DDL operation, references a constraint name that exists in the database but is not associated with the specified table. This commonly happens due to a naming mismatch, a typo in the script, or because the constraint was moved, renamed, or recreated on a different table during a schema migration. It can also surface when scripts are run against the wrong database or schema, where a constraint with an identical name exists but belongs to a different parent table.

Step-by-Step Resolution Guide

Step 1: Verify the Constraint and Table Relationship

  • Open SQL Server Management Studio (SSMS) connected to your SQL Server 2025 instance.
  • Run the following query to confirm which table the constraint actually belongs to:
  SELECT 
      t.name AS TableName, 
      c.name AS ConstraintName 
  FROM sys.objects c
  INNER JOIN sys.tables t ON c.parent_object_id = t.object_id
  WHERE c.name = 'YourConstraintName';
  • Compare the TableName result against the table name used in your original script.

Step 2: Correct the Script or Target Table

  • Update your ALTER TABLE statement to reference the correct table name returned in Step 1.
  • If using a deployment or migration script (e.g., DACPAC or SSDT project), check for hardcoded table names that may have changed since the script was last updated.
  • Re-run the corrected script:
  ALTER TABLE CorrectTableName DROP CONSTRAINT YourConstraintName;

Step 3: Check for Duplicate Constraint Names Across Schemas

  • If your database uses multiple schemas (e.g., dbo, Sales, HR), verify you are not confusing two constraints with the same name in different schemas.
  • Run this query to check for schema-level duplicates:
  SELECT 
      s.name AS SchemaName, 
      t.name AS TableName, 
      c.name AS ConstraintName
  FROM sys.objects c
  INNER JOIN sys.tables t ON c.parent_object_id = t.object_id
  INNER JOIN sys.schemas s ON t.schema_id = s.schema_id
  WHERE c.name = 'YourConstraintName';
  • Adjust your script to fully qualify the schema and table name (e.g., Sales.Orders) to avoid ambiguity.

Step 4: Rebuild Script from Current Database Metadata

  • If the script originated from an older backup or version-controlled file, regenerate the DROP CONSTRAINT or ALTER TABLE statement directly from the live database.
  • In SSMS, right-click the table → Script Table as → DROP To → New Query Editor Window to get an accurate, up-to-date script.
  • Execute the freshly generated script to avoid stale metadata references.

Alternative or Verification Steps

  • After applying the fix, re-run the original failing statement to confirm Error 3733 no longer appears and the constraint operation completes successfully.
  • If the issue persists, check sys.foreign_keys, sys.check_constraints, or sys.key_constraints directly (depending on constraint type) to rule out system catalog inconsistencies, and consider running DBCC CHECKDB to rule out metadata corruption.

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

Troubleshooting Guide: SQL Server Error 3732 – Cannot Drop Type Due to Dependent Objects

Why This Error Happens

Error 3732 occurs when you attempt to drop a user-defined type (UDT) or user-defined table type that is still referenced by one or more database objects, such as tables, stored procedures, functions, or parameters. SQL Server 2025 enforces strict schema-binding dependency checks to maintain referential integrity within the database engine, and it will block the DROP TYPE statement until all dependencies are removed. This is not a corruption or permissions issue, but rather a dependency-resolution failure caused by incomplete cleanup of objects that consume the type.

Step-by-Step Resolution Guide

Step 1: Identify All Dependent Objects

  • Run the following query against the target database to list every object referencing the type:
  SELECT o.name AS referencing_object, o.type_desc
  FROM sys.sql_expression_dependencies d
  JOIN sys.objects o ON d.referencing_id = o.object_id
  WHERE d.referenced_entity_name = 'YourTypeName';
  • Also check sys.columns and sys.parameters for columns or procedure parameters declared using the type, since table columns and parameters are not always captured in sys.sql_expression_dependencies.
  • Use SSMS 21 (updated for SQL Server 2025) and view the type’s “View Dependencies” option by right-clicking it in Object Explorer for a GUI-based cross-check.

Step 2: Remove or Alter Dependent References

  • For tables: Drop the dependent columns or alter the column to use a compatible native data type instead of the UDT, using ALTER TABLE ... DROP COLUMN or ALTER TABLE ... ALTER COLUMN.
  • For stored procedures/functions: Drop or modify the procedure/function so it no longer references the type as a parameter or variable declaration.
  • For table-valued parameters: Update the signature of any stored procedures using the type as a parameter type, then recompile with sp_recompile.
  • Execute changes in a transaction block during a maintenance window to avoid breaking production workflows:
  BEGIN TRAN;
  ALTER PROCEDURE dbo.YourProc ... 
  COMMIT;

Step 3: Drop the Type

  • Once all dependencies are cleared, re-run the drop command:
  DROP TYPE dbo.YourTypeName;
  • If the error persists, re-run the dependency query from Step 1, as hidden dependencies (e.g., in encrypted or obfuscated modules) may still exist.

Step 4: Clear Cached Plan Dependencies (If Applicable)

  • Sometimes SQL Server’s plan cache retains stale dependency metadata, especially after recent schema changes in SQL Server 2025’s enhanced Query Store.
  • Clear the specific database’s plan cache to force dependency metadata refresh:
  DBCC FLUSHPROCINDB (DB_ID('YourDatabaseName'));
  • Retry the DROP TYPE statement afterward.

Alternative or Verification Steps

  • Verify the fix by re-running the Step 1 dependency query — it should return zero rows before attempting DROP TYPE again.
  • If the type still cannot be dropped due to dependencies in encrypted stored procedures or legacy linked objects, consider using sys.dm_sql_referencing_entities('dbo.YourTypeName', 'TYPE') for a more exhaustive dependency scan, then manually script out and recreate those objects without the type reference.

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

Troubleshooting Guide: SQL Server Error 3729

Why This Error Happens

Error 3729 occurs when you attempt to drop, alter, or modify a database object (such as a table, view, function, or schema) that is still referenced by another object through a schema-bound dependency. SQL Server 2025 enforces SCHEMABINDING constraints strictly, meaning that views, functions, or computed columns bound to the target object will block any structural changes until the dependency is removed. This is a safeguard against breaking dependent objects, not a sign of corruption, but it commonly surfaces during schema migrations or deployment scripts on Windows Server 2025/Windows 11 environments.

Step-by-Step Resolution Guide

Step 1: Identify the Referencing Object

  • Run sys.sql_expression_dependencies or sys.dm_sql_referencing_entities('SchemaName.ObjectName', 'OBJECT') to find exactly which object is referencing your target.
  • Example query:
  SELECT referencing_schema_name, referencing_entity_name 
  FROM sys.dm_sql_referencing_entities('dbo.YourTable', 'OBJECT');
  • Note the full name of the dependent object(s) returned, as you will need this in Step 2.

Step 2: Remove or Alter the Schema Binding

  • Script out the definition of the referencing object (right-click → Script Object as → CREATE in SQL Server Management Studio, or use sp_helptext 'ReferencingObject').
  • Save the script locally, then run an ALTER VIEW or ALTER FUNCTION statement that removes the WITH SCHEMABINDING clause, or temporarily DROP the dependent object if it is safe to recreate later.
  • Execute the modified script to detach the dependency:
  ALTER VIEW dbo.ReferencingView
  AS
  SELECT ColumnName FROM dbo.YourTable; -- without SCHEMABINDING

Step 3: Perform the Original Action

  • Retry the original DROP, ALTER, or DROP COLUMN statement on the target object now that the binding is cleared.
  • Confirm the command completes without throwing Error 3729 in the Messages pane of SQL Server Management Studio (SSMS) or Azure Data Studio.

Step 4: Recreate the Dependent Object (If Needed)

  • If you dropped or altered the referencing view/function in Step 2, recreate it using the script you saved earlier, re-adding WITH SCHEMABINDING if required for your workload.
  • Validate that the new object compiles successfully with SET NOEXEC OFF and no syntax errors in the query window.

Alternative or Verification Steps

  • Verify the fix by re-running sys.dm_sql_referencing_entities against the target object — it should return zero rows if all schema-bound dependencies have been cleared.
  • If the dependency chain is deep (multiple nested views/functions), consider using the free sp_helptext script recursively or a third-party dependency viewer (like Redgate SQL Dependency Tracker) to map the full chain before attempting any drops in a production environment.

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

Troubleshooting Guide: SQL Server Error 3730

Why This Error Happens

This error occurs because the default constraint you are attempting to drop is currently referenced by a foreign key relationship configured with the ON UPDATE SET DEFAULT or ON DELETE SET DEFAULT referential action. SQL Server 2025 prevents the removal of this constraint because doing so would leave the foreign key without a valid default value to revert to during cascading update or delete operations. Essentially, the dependency chain between the foreign key and the default constraint must be broken before the default definition can be removed.

Step-by-Step Resolution Guide

Step 1: Identify the Dependent Foreign Key

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio connected to your Windows Server 2025 instance.
  • Run a query against sys.foreign_keys to locate the specific constraint using the SET DEFAULT action:
SELECT name, delete_referential_action_desc, update_referential_action_desc 
FROM sys.foreign_keys 
WHERE referenced_object_id = OBJECT_ID('YourTableName');
  • Note the name of the Foreign Key and the parent table involved.

Step 2: Drop or Alter the Foreign Key Constraint

  • Before touching the default, you must remove the dependency. Execute an ALTER TABLE command to drop the specific foreign key found in Step 1.
  • Use the following syntax, replacing the placeholders with your actual table and constraint names:
ALTER TABLE YourTableName 
DROP CONSTRAINT YourForeignKeyName;
  • If the SET DEFAULT behavior is required for business logic, consider changing it to NO ACTION instead of deleting it entirely, depending on your application requirements.

Step 3: Drop the Original Default Constraint

  • With the foreign key dependency removed, you can now safely execute the original command that was failing.
  • Run the DROP CONSTRAINT command for the default value:
ALTER TABLE YourTableName 
DROP CONSTRAINT YourDefaultConstraintName;
  • Verify that the command completes without throwing Error 3730.

Step 4: Re-create the Foreign Key (Optional)

  • If you need to maintain referential integrity but without the SET DEFAULT action, re-add the foreign key using NO ACTION or CASCADE.
  • Ensure the new logic aligns with how you want data integrity handled in Windows Server 2025 environments.

Alternative or Verification Steps

  • Verification: Query sys.default_constraints to confirm the object no longer exists in the schema, and check sys.foreign_keys to ensure the relationship logic matches your intended configuration.
  • Alternative: If dropping the Foreign Key is not permitted due to production constraints, you can disable constraint checking temporarily using ALTER TABLE YourTableName NOCHECK CONSTRAINT YourForeignKeyName, though this is generally not recommended for long-term use in a production database.

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

Why This Error Happens

Error 3728 occurs when a T-SQL statement—typically ALTER TABLE ... DROP CONSTRAINT, sp_helpconstraint, or sp_unbindefault—references an object name that exists in the database but is not actually registered as a constraint object (PRIMARY KEY, FOREIGN KEY, CHECK, DEFAULT, or UNIQUE). This usually happens because the name belongs to an index, a table, or a different schema-bound object, or because the name was typed incorrectly with inconsistent casing or schema prefixing. In rarer cases, this error surfaces after a failed schema migration or replication job where system catalog views (sys.objects, sys.check_constraints, sys.key_constraints) have become out of sync due to catalog corruption.

Step-by-Step Resolution Guide

Step 1: Verify the Object Type Before Referencing It

  • Run SELECT name, type_desc FROM sys.objects WHERE name = 'YourObjectName'; to confirm the object is actually a constraint.
  • Check for type_desc values like CHECK_CONSTRAINT, DEFAULT_CONSTRAINT, FOREIGN_KEY_CONSTRAINT, or PRIMARY_KEY_CONSTRAINT. If it returns INDEX or USER_TABLE, you are targeting the wrong object.
  • On Windows Server 2025, open SQL Server Management Studio (SSMS 21) as Administrator to ensure you have full metadata read access.

Step 2: Correct the Schema and Naming Reference

  • Run SELECT s.name AS schema_name, o.name AS constraint_name FROM sys.objects o JOIN sys.schemas s ON o.schema_id = s.schema_id WHERE o.type IN ('C','D','F','PK','UQ'); to get the fully qualified constraint name.
  • Re-run your ALTER TABLE dbo.YourTable DROP CONSTRAINT [CorrectConstraintName]; using the exact name and schema returned above.
  • Avoid using index names or auto-generated statistics names in place of constraint names.

Step 3: Refresh and Validate System Catalog Metadata

  • Execute DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to rule out catalog-level corruption.
  • If corruption is found, restore from the latest known-good backup rather than running repair options that allow data loss.
  • Restart the SQL Server service via services.msc or Restart-Service -Name 'MSSQLSERVER' in an elevated PowerShell session on Windows Server 2025 to clear any cached execution plans referencing stale metadata.

Step 4: Rebuild the Constraint Definition if Missing

  • If the intended constraint was dropped accidentally or never created, recreate it explicitly, e.g.:
    ALTER TABLE dbo.YourTable ADD CONSTRAINT CK_YourTable_Column CHECK (Column > 0);
  • Confirm successful creation with sp_helpconstraint 'dbo.YourTable';.

Alternative or Verification Steps

  • Run sp_helpconstraint 'dbo.YourTable'; after applying changes — it should list the constraint without throwing Error 3728.
  • If the issue persists, use sys.check_constraints, sys.default_constraints, and sys.key_constraints views directly to cross-reference object IDs and confirm no naming collisions exist across schemas.

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

Troubleshooting Guide: SQL Server Error 3727 — “Could Not Drop Constraint”

Why This Error Happens

Error 3727 occurs when SQL Server 2025 attempts to drop a constraint that is either referenced by another dependent object (such as a foreign key, check constraint, or default binding) or is involved in an active replication/Change Data Capture (CDC) schema lock. This error is almost always a secondary message, meaning the real root cause is logged in a preceding error (commonly Error 3725 or Error 5074) that gets truncated or missed in application logs. Corrupted metadata in the sys.foreign_keys or sys.check_constraints catalog views after an improper schema migration can also trigger this failure on Windows Server 2025 hosts.

Step-by-Step Resolution Guide

Step 1: Identify the Preceding Error in the SQL Server Log

  • Open SQL Server Management Studio (SSMS) and connect to the instance.
  • Navigate to Management > SQL Server Logs and locate the error immediately preceding Event ID 3727.
  • Alternatively, run the following query to check recent errors:
  EXEC sp_readerrorlog 0, 1, 'constraint';
  • Note the specific object name or constraint ID referenced in the prior error (e.g., 3725 “referenced by FOREIGN KEY”).

Step 2: Check for Dependent Objects Before Dropping

  • Run a dependency check to see what is blocking the drop:
  SELECT OBJECT_NAME(parent_object_id) AS TableName, name AS ConstraintName 
  FROM sys.foreign_keys 
  WHERE referenced_object_id = OBJECT_ID('YourTableName');
  • If a foreign key is found, drop the dependent foreign key constraint first using:
  ALTER TABLE [dbo].[ChildTable] DROP CONSTRAINT [FK_ConstraintName];
  • Re-attempt the original ALTER TABLE ... DROP CONSTRAINT command on the parent table.

Step 3: Verify Replication and CDC Status

  • Check if the table is enabled for replication or Change Data Capture (CDC), as this locks constraint modifications.
  EXEC sys.sp_cdc_help_change_data_capture;
  • If CDC is active on the table, disable it temporarily:
  EXEC sys.sp_cdc_disable_table 
  @source_schema = N'dbo', 
  @source_name = N'YourTableName', 
  @capture_instance = N'all';
  • Retry the DROP CONSTRAINT statement once CDC is disabled.

Step 4: Rebuild Corrupted Metadata (If Steps 1-3 Fail)

  • Run DBCC CHECKDB to rule out catalog corruption on Windows Server 2025 storage volumes.
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is found in system tables, restore the database from the last known good backup rather than attempting a repair, as REPAIR_ALLOW_DATA_LOSS can affect constraint integrity.

Alternative or Verification Steps

  • Verify the Fix: After dropping the dependent objects, run sp_help 'YourTableName' to confirm the constraint no longer appears in the table schema, and check the SQL Server log to ensure no new 3727 or 3725 errors are generated.
  • Alternative Solution: If the constraint absolutely cannot be dropped due to system-table locks, restart the SQL Server 2025 service via services.msc on Windows Server 2025 to clear any stale schema locks, then immediately re-run the ALTER TABLE script in a single transaction.

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

Troubleshooting Guide: SQL Server Error 3726 – Could Not Drop Object Referenced by FOREIGN KEY Constraint

Why This Error Happens

This error occurs because the object you are attempting to drop (typically a table) has one or more FOREIGN KEY constraints from another table referencing it, and SQL Server prevents the drop operation to maintain referential integrity. It can also happen if you are trying to drop a table within a single DROP TABLE statement without first removing or accounting for dependent constraints. In rare cases, this is compounded by orphaned metadata in the system catalog views if a previous schema migration was interrupted.

Step-by-Step Resolution Guide

Step 1: Identify All Dependent Foreign Key Constraints

  • Open SQL Server Management Studio (SSMS) connected to your Windows Server 2025 / Windows 11 instance.
  • Run the following query to find every FK constraint referencing your target table:
SELECT 
    fk.name AS ForeignKeyName,
    OBJECT_NAME(fk.parent_object_id) AS ReferencingTable
FROM sys.foreign_keys fk
WHERE fk.referenced_object_id = OBJECT_ID('YourSchema.YourTableName');
  • Note down every ForeignKeyName and ReferencingTable returned in the result set.

Step 2: Drop the Foreign Key Constraints

  • For each referencing table identified in Step 1, run an ALTER TABLE statement to drop the constraint:
ALTER TABLE YourSchema.ReferencingTable
DROP CONSTRAINT ForeignKeyName;
  • Repeat this for every constraint listed; do not skip any, as a single remaining reference will trigger Error 3726 again.
  • If there are many constraints, consider generating a dynamic script using sys.foreign_keys to automate the drop statements.

Step 3: Drop the Target Table or Object

  • Once all dependent constraints are removed, execute the original drop command:
DROP TABLE YourSchema.YourTableName;
  • Confirm there are no error messages returned in the SSMS output pane.

Step 4: Recreate Constraints If Needed (Optional)

  • If the referencing tables still require a relationship (e.g., to a new or renamed table), recreate the FK constraints using ALTER TABLE ... ADD CONSTRAINT.
  • Update the constraint definition to point to the new object name or structure as required by your schema redesign.

Alternative or Verification Steps

  • Verify the fix by re-running the Step 1 query; if it returns zero rows for the original table name, all foreign key dependencies have been successfully cleared and the drop was successful.
  • If you need to remove a table and all its dependencies in a single operation without manually scripting each constraint, consider using DROP TABLE ... CASCADE behavior via a pre-built cleanup script, or temporarily disable constraint enforcement with ALTER TABLE ... NOCHECK CONSTRAINT ALL (not recommended for production without a full rollback plan).

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

Troubleshooting Guide: SQL Server Error 3725

Why This Error Happens

This error occurs when you attempt to drop, disable, or alter a constraint (typically a PRIMARY KEY, UNIQUE, or CHECK constraint) that is still being referenced by a FOREIGN KEY constraint on another table. SQL Server 2025 enforces referential integrity at the engine level, so it blocks the operation to prevent orphaned relationships between tables. This commonly happens during schema migrations, index rebuilds, or deployment scripts where dependent foreign keys were not accounted for before modifying the parent constraint.

Step-by-Step Resolution Guide

Step 1: Identify the Dependent Foreign Key

  • Run the following query to find which table and constraint reference the parent constraint:
SELECT fk.name AS ForeignKeyName, 
       OBJECT_NAME(fk.parent_object_id) AS ReferencingTable
FROM sys.foreign_keys fk
WHERE fk.referenced_object_id = OBJECT_ID('YourParentTableName');
  • Note the exact names of the referencing table and foreign key constraint returned.

Step 2: Drop the Dependent Foreign Key Constraint Temporarily

  • Open SQL Server Management Studio (SSMS) 2025 or Azure Data Studio connected to your instance on Windows Server 2025 / Windows 11.
  • Execute a script to drop the referencing foreign key before altering the parent:
ALTER TABLE dbo.ReferencingTable 
DROP CONSTRAINT FK_ReferencingTable_ParentTable;
  • Confirm there are no other dependencies using sys.foreign_keys again.

Step 3: Modify or Drop the Original Constraint

  • Now perform the originally intended action on the parent table (e.g., dropping a PRIMARY KEY or UNIQUE constraint):
ALTER TABLE dbo.ParentTable 
DROP CONSTRAINT PK_ParentTable;
  • Proceed with any schema changes, such as altering column data types or rebuilding the key.

Step 4: Recreate the Foreign Key Constraint

  • Once the parent constraint is successfully modified, restore referential integrity by recreating the foreign key:
ALTER TABLE dbo.ReferencingTable
ADD CONSTRAINT FK_ReferencingTable_ParentTable 
FOREIGN KEY (ColumnName) REFERENCES dbo.ParentTable(ColumnName);
  • Verify the constraint was created successfully by checking sys.foreign_keys or the Object Explorer in SSMS.

Alternative or Verification Steps

  • Verify the fix by attempting the original ALTER or DROP statement again on the parent table; it should now execute without Error 3725.
  • If you cannot drop the foreign key due to application downtime constraints, consider using WITH CHECK and NOCHECK options temporarily, or schedule the change during a maintenance window using SQL Server Agent jobs.

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

Troubleshooting Guide: SQL Server Error 3724

Why This Error Happens

This error occurs when an attempt is made to drop, alter, or modify a database object (such as a table, stored procedure, or schema) that is currently referenced as an article in a replication publication. SQL Server protects objects that are actively being tracked by replication (transactional, merge, or snapshot) to prevent breaking the publication/subscription relationship or causing data inconsistency at the Subscriber. Until the object is removed from the replication topology or replication is properly reconfigured, SQL Server 2025 will block the DDL operation and raise this error.

Step-by-Step Resolution Guide

Step 1: Identify the Replication Dependency

  • Connect to the Publisher database using SQL Server Management Studio (SSMS) 21 or later.
  • Run the following query to confirm the object is published:
  EXEC sp_helparticle @publication = N'YourPublicationName', @article = N'YourObjectName';
  • Alternatively, check sys.sysarticles in the published database to cross-reference the object ID.

Step 2: Remove the Object from the Publication

  • Open Replication > Local Publications in SSMS, right-click the relevant publication, and select Properties > Articles.
  • Uncheck the object you need to modify or drop, then click OK to apply changes.
  • Alternatively, use T-SQL to drop the article:
  EXEC sp_droparticle @publication = N'YourPublicationName', @article = N'YourObjectName', @force_invalidate_snapshot = 1;

Step 3: Apply Your Schema Change

  • With the article removed, re-run the original ALTER, DROP, or TRUNCATE statement that triggered Error 3724.
  • If the change affects multiple articles, consider stopping the Log Reader Agent and Distribution Agent temporarily via Replication Monitor to avoid conflicts during the change.

Step 4: Re-add the Object to Replication (If Needed)

  • If the object must remain part of replication, re-add it as an article after the schema change:
  EXEC sp_addarticle @publication = N'YourPublicationName', @article = N'YourObjectName', @source_object = N'YourObjectName';
  • Generate a new snapshot via the Snapshot Agent to synchronize Subscribers with the updated schema.

Alternative or Verification Steps

  • Verify the fix by re-running the original DDL statement; it should complete without raising Error 3724.
  • If you cannot remove the article (e.g., due to business restrictions), use sp_changearticlecolumn or the @schema_option replication property to allow certain schema changes to replicate automatically without dropping the article first.

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

Why This Error Happens

Error 3722 (“Task has been aborted”) typically occurs when SQL Server 2025 attempts to drop or modify a system object, such as a database schema or metadata entry, while it is still referenced by another active session or internal process. This is often triggered during a DROP DATABASE, DROP SCHEMA, or replication cleanup task that is interrupted due to a locking conflict or insufficient permissions on the underlying system catalog. In some cases, corrupted system metadata or an abruptly terminated transaction log can leave the database engine unable to complete the housekeeping task, causing it to abort.

Step-by-Step Resolution Guide

Step 1: Identify the Blocking Session or Process

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Run sp_who2 or query sys.dm_exec_requests to identify any session holding a lock on the target database or object.
  • Note the blocking_session_id column; if a value other than 0 appears, that session is preventing the task from completing.

Step 2: Terminate the Conflicting Session (If Safe)

  • Once the blocking session is identified, verify it is not a critical system process.
  • Run KILL <session_id>; in a new query window to terminate the blocking session.
  • Re-run the original command (e.g., DROP DATABASE) that triggered Error 3722.

Step 3: Check and Repair System Permissions

  • Ensure the service account running SQL Server 2025 has sysadmin or appropriate db_owner rights on the affected database.
  • On Windows Server 2025 / Windows 11, go to Control Panel > Administrative Tools > Services, locate “SQL Server (MSSQLSERVER)” and confirm it is running under an account with full local admin rights to C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA.
  • Restart the SQL Server service if permissions were changed.

Step 4: Run DBCC CHECKDB for Corruption

  • Open a new query window and execute: DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORS;
  • Review the output for any allocation or consistency errors that may be causing the abort.
  • If corruption is found, run DBCC CHECKDB ('YourDatabaseName') WITH REPAIR_ALLOW_DATA_LOSS; only after taking a full backup.

Step 5: Restart SQL Server Service and Clear Tempdb

  • Stop the SQL Server service via services.msc or run net stop MSSQLSERVER in an elevated Command Prompt.
  • Delete or verify the integrity of tempdb files located in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\tempdb.mdf.
  • Restart the service with net start MSSQLSERVER and attempt the original operation again.

Alternative or Verification Steps

  • After applying the fix, re-run the original command that caused Error 3722 and confirm it completes without being aborted; check the SQL Server Error Log via EXEC sp_readerrorlog; for confirmation.
  • If the issue persists, consider restoring the affected database from a known good backup or failing over to a secondary replica if using Always On Availability Groups.

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

Troubleshooting Guide: SQL Server Error 3723 – Explicit DROP INDEX Not Allowed

Why This Error Happens

This error occurs because SQL Server automatically creates a system-managed index when you define a PRIMARY KEY or UNIQUE constraint on a table, and this index is tightly coupled to that constraint’s enforcement logic. SQL Server 2025 blocks direct DROP INDEX statements against these constraint-backed indexes to prevent data integrity violations, since removing the index without removing the constraint would leave the engine unable to enforce uniqueness rules. The only supported path to remove such an index is by dropping or altering the constraint itself, not the index directly.

Step-by-Step Resolution Guide

Step 1: Identify the Constraint Tied to the Index

  • Run the following query in SQL Server Management Studio (SSMS) or Azure Data Studio to find the constraint name associated with the index:
  • SELECT i.name AS IndexName, c.name AS ConstraintName, t.name AS TableName FROM sys.indexes i JOIN sys.key_constraints c ON i.object_id = c.parent_object_id AND i.index_id = c.unique_index_id JOIN sys.tables t ON i.object_id = t.object_id WHERE i.name = 'YourIndexName';
  • Confirm whether it is a PRIMARY KEY or UNIQUE constraint enforcing the index.

Step 2: Drop the Constraint Instead of the Index

  • Use ALTER TABLE to drop the constraint, which will automatically remove the underlying index:
  • ALTER TABLE dbo.YourTableName DROP CONSTRAINT YourConstraintName;
  • Ensure no foreign keys reference this constraint before dropping it; if they do, drop or update the dependent foreign key constraints first.

Step 3: Recreate the Index or Constraint as Needed

  • If you only wanted to modify the index (e.g., change fill factor or partitioning), recreate the constraint with the desired index properties:
  • ALTER TABLE dbo.YourTableName ADD CONSTRAINT YourConstraintName PRIMARY KEY (ColumnName) WITH (FILLFACTOR = 90);
  • On Windows Server 2025, verify sufficient disk space on the SQL Server data drive (default: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\) since rebuilding large indexes requires temporary space.

Step 4: Check for Dependent Objects Before Changes

  • Query sys.foreign_keys to ensure no other tables depend on the constraint you’re dropping:
  • SELECT * FROM sys.foreign_keys WHERE referenced_object_id = OBJECT_ID('dbo.YourTableName');
  • Update or temporarily disable dependent foreign keys if necessary using ALTER TABLE ... NOCHECK CONSTRAINT.

Alternative or Verification Steps

  • After dropping and recreating the constraint, verify the index exists correctly by running sys.indexes again and confirming the is_primary_key or is_unique_constraint flag is set as expected.
  • If you need to modify index properties without affecting the constraint logic, consider using ALTER INDEX ... REBUILD or ALTER INDEX ... REORGANIZE instead of dropping it entirely, as these operations are permitted on constraint-backed indexes.

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

Troubleshooting Guide: Error 3721 – Type Cannot Be Renamed Due to Object Reference

Why This Error Happens

This error occurs when you attempt to rename a user-defined type (UDT) or data type in SQL Server 2025 while one or more database objects—such as tables, views, stored procedures, or functions—still hold a schema-bound or dependency reference to it. SQL Server’s metadata engine blocks the rename operation to prevent breaking the dependency chain and causing orphaned references in the system catalog (sys.sqlexpressiondependencies). This commonly surfaces after schema migrations, upgrades to SQL Server 2025, or when using sp_rename on types tied to computed columns, CHECK constraints, or CLR-based type definitions.

Step-by-Step Resolution Guide

Step 1: Identify All Dependent Objects

  • Open SQL Server Management Studio (SSMS) and connect to the target instance on Windows Server 2025.
  • Run the following query to locate all objects referencing the type:
  SELECT referencing_schema_name, referencing_entity_name, referencing_class_desc
  FROM sys.dm_sql_referencing_entities('dbo.YourTypeName', 'TYPE');
  • Note every object returned, as each must be addressed before renaming can succeed.

Step 2: Script Out and Drop Dependent Bindings

  • In SSMS, right-click each dependent object (table, column, or procedure) and select Script Table/Object as > DROP To > New Query Editor Window to save a backup copy.
  • Temporarily drop CHECK constraints, computed columns, or DEFAULT bindings that reference the type using:
  ALTER TABLE dbo.YourTable DROP CONSTRAINT YourConstraintName;
  • If the type is used in a schema-bound view or function, drop the schema binding first with ALTER VIEW ... WITH SCHEMABINDING removed, or drop the view/function entirely.

Step 3: Rename the Type Using sp_rename

  • Execute the rename operation now that dependencies are cleared:
  EXEC sp_rename 'dbo.OldTypeName', 'NewTypeName';
  • Confirm no error 3721 is returned in the Messages pane.

Step 4: Recreate Dependent Objects

  • Re-run the DROP scripts saved in Step 2, updating them to reference NewTypeName instead of the old type name.
  • Re-add constraints, computed columns, or schema-bound views using ALTER TABLE or CREATE VIEW with the corrected type reference.
  • Restart the SQL Server service via services.msc on Windows Server 2025 if metadata caching issues persist (SQL Server (MSSQLSERVER) service).

Alternative or Verification Steps

  • Verify the fix by re-running the sys.dm_sql_referencing_entities query from Step 1—it should return zero rows for the old type name, and querying sys.types should show the new name correctly registered.
  • If dependencies are too numerous or complex to drop manually, use sp_rename as a last resort only after exporting the full database schema via Generate Scripts Wizard in SSMS, then perform the rename during a planned maintenance window with a full database backup in place.

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

Troubleshooting Guide: SQL Server Error 3718 – Could Not Drop Index

Why This Error Happens

Error 3718 occurs when the metadata referenced by the DROP INDEX statement no longer aligns with the actual entries in the system catalog views (the modern equivalent of sysindexes). This typically happens due to catalog corruption, an interrupted DDL transaction (such as a crash or forced termination during an index rebuild), or because the object ID referenced in the command does not match an existing table or clustered index. In some cases, this is also triggered when replication or CDC metadata becomes desynchronized from the base table structure on Windows Server 2025 environments.

Step-by-Step Resolution Guide

Step 1: Verify the Object Exists and Check Metadata Consistency

  • Open SQL Server Management Studio (SSMS) and run SELECT OBJECT_ID('YourTableName') to confirm the table is recognized by the engine.
  • Cross-reference the index using SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID('YourTableName') to see if the specific index name actually exists in the catalog.
  • If the index name returns NULL or is missing entirely, the metadata pointer is broken, confirming the root cause.

Step 2: Run DBCC CHECKDB to Identify Corruption

  • Execute DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; in a New Query window.
  • Review the output for allocation errors or consistency errors specifically related to sys.sysidxstats or sys.sysschobjs.
  • If corruption is confirmed, note the Object ID and Index ID provided in the error output for the next repair step.

Step 3: Repair the System Catalog

  • If DBCC CHECKDB flags errors, first attempt a restore from a known-good backup, as this is the safest industry-standard fix.
  • If no backup is available, run DBCC CHECKDB('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS). Note: Set the database to SINGLE_USER mode first using ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE;.
  • Once repairs are complete, switch the database back to multi-user mode: ALTER DATABASE YourDatabaseName SET MULTI_USER;.

Step 4: Rebuild the Index via Object Recreation

  • If the index metadata is unrecoverable, manually script out the table definition and existing valid indexes using the SSMS “Generate Scripts” wizard.
  • Drop and recreate the specific broken index definition manually using a fully qualified command: CREATE INDEX IX_Test ON dbo.YourTableName(ColumnName); followed immediately by a proper DROP INDEX IX_Test ON dbo.YourTableName; to clear the “ghost” reference.

Alternative or Verification Steps

  • Verification: Re-run the DROP INDEX command that initially failed; if successful, confirm the index is gone by refreshing the “Indexes” folder in SSMS Object Explorer.
  • Alternative: If the error persists after DBCC CHECKDB repair, export the data to a new table using the SQL Server Import/Export Wizard, drop the corrupted table entirely, and rename the new table to match the original schema name.

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

Troubleshooting Guide: Error 3717 – Cannot DROP DEFAULT Constraint in SQL Server 2025

Why This Error Happens

This error occurs because the default value was created as a named constraint (object-level default) rather than a legacy standalone default binding. In modern versions of SQL Server, including SQL Server 2025, constraint-based defaults are tied directly to the table definition and cannot be removed using the older DROP DEFAULT T-SQL syntax. Instead, the engine requires you to drop the constraint through the ALTER TABLE ... DROP CONSTRAINT syntax, since the default is treated as a schema-bound object belonging to the table rather than an independent database object.

Step-by-Step Resolution Guide

Step 1: Identify the Constraint Name

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio connected to your SQL Server 2025 instance.
  • Run the following query to find the exact name of the default constraint:
  SELECT dc.name AS ConstraintName, c.name AS ColumnName, t.name AS TableName
  FROM sys.default_constraints dc
  JOIN sys.columns c ON dc.parent_object_id = c.object_id AND dc.parent_column_id = c.column_id
  JOIN sys.tables t ON dc.parent_object_id = t.object_id
  WHERE t.name = 'YourTableName';
  • Note the exact ConstraintName returned (e.g., DF__YourTable__Column__1A14E395).

Step 2: Drop the Constraint Using ALTER TABLE

  • Replace the deprecated DROP DEFAULT statement with the correct ALTER TABLE syntax:
  ALTER TABLE dbo.YourTableName
  DROP CONSTRAINT DF__YourTable__Column__1A14E395;
  • Ensure you are using the fully qualified schema name (e.g., dbo.YourTableName) to avoid object resolution errors on Windows Server 2025 environments with multiple schemas.

Step 3: Re-run the Script with Updated Syntax

  • If the original script was auto-generated or inherited from a legacy SQL Server version (pre-2012), update any instance of:
  DROP DEFAULT ConstraintName;

to:

  ALTER TABLE TableName DROP CONSTRAINT ConstraintName;
  • Save and re-execute the corrected script in SSMS.

Step 4: Verify Permissions

  • Confirm the executing user has ALTER permission on the table.
  • Run SELECT * FROM fn_my_permissions('dbo.YourTableName', 'OBJECT'); to confirm ALTER is listed in the results.

Alternative or Verification Steps

  • After running the ALTER TABLE DROP CONSTRAINT statement, re-query sys.default_constraints for the table—if the constraint no longer appears, the fix was successful.
  • If the constraint name is unknown or auto-generated with random characters, use SSMS Object Explorer: navigate to Table > Constraints, right-click the default constraint, and select Script Constraint As > DROP To > New Query Window to auto-generate the correct ALTER TABLE syntax.

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

Troubleshooting Guide: SQL Server Error 3716

Why This Error Happens

This error occurs when you attempt to drop a database object (such as a default, rule, or table) that is still bound to one or more other objects via a binding relationship, such as a DEFAULT or RULE binding, or a schema-bound view/function dependency. SQL Server enforces referential integrity on these bindings, so it blocks the DROP statement until all dependent bindings are explicitly removed first. This commonly happens when a column or user-defined data type still references the object through sp_bindefault, sp_bindrule, or WITH SCHEMABINDING.

Step-by-Step Resolution Guide

Step 1: Identify the Bound Dependencies

  • Run sp_depends 'ObjectName' or query sys.sql_expression_dependencies to list all objects currently bound to the target object.
  • Check sys.objects and sys.default_constraints (or sys.rules in legacy compatibility mode) to confirm whether the object is a rule, default, or schema-bound reference.
  • Note every table, column, or user-defined type (UDT) returned in the results, as these must be unbound before proceeding.

Step 2: Unbind the Object from Dependent Columns or Types

  • For defaults, run EXEC sp_unbindefault 'TableName.ColumnName'; for each dependent column.
  • For rules, run EXEC sp_unbindrule 'TableName.ColumnName'; for each dependent column.
  • If the object is referenced by a WITH SCHEMABINDING view or function, run ALTER VIEW or ALTER FUNCTION to remove the schema binding or drop the dependent object first.

Step 3: Drop the Original Object

  • Once all dependencies are cleared, re-run the original DROP DEFAULT, DROP RULE, or DROP TABLE statement.
  • Example: DROP DEFAULT dbo.DF_DefaultName;
  • If the object is still reported as bound, repeat Step 1 to confirm no residual bindings remain in other schemas or databases.

Step 4: Restart Dependent Services (If Using SSMS Cache)

  • Close and reopen SQL Server Management Studio (SSMS) on Windows Server 2025 or Windows 11 to clear any cached metadata.
  • Alternatively, run DBCC FREEPROCCACHE to ensure SQL Server isn’t referencing a stale execution plan tied to the old binding.

Alternative or Verification Steps

  • Verify the fix by re-running sp_depends 'ObjectName' — it should return no rows, confirming the object is fully unbound.
  • If the error persists, check for bindings on associated user-defined data types (sp_help 'TypeName'), as these are a common overlooked source of Error 3716.

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

Troubleshooting Guide: Error 3710 – Cannot Detach Database in Minimally Configured Mode

Why This Error Happens

Error 3710 occurs because SQL Server 2025, when started in minimally configured mode (via the -f startup parameter), restricts certain operations to maintain a stable recovery environment, and detaching a database is explicitly blocked in this state. This mode is designed for emergency administration (such as resetting configuration options or recovering from startup failures), so the Database Engine intentionally limits actions that alter the physical state of the server, including detach, drop, or restore operations. Attempting to detach a database while the server is running this way triggers Error 3710 because the engine cannot guarantee a safe detach outside of normal operating mode.

Step-by-Step Resolution Guide

Step 1: Confirm the Server Is Running in Minimal Configuration Mode

  • Open SQL Server Configuration Manager on Windows Server 2025 / Windows 11.
  • Navigate to SQL Server Services, right-click your instance, and select Properties.
  • Check the Startup Parameters tab for the presence of -f.
  • Alternatively, run the following query in SQLCMD or Azure Data Studio to confirm minimal mode:
  SELECT SERVERPROPERTY('IsSingleUser') AS IsMinimalConfig;

Step 2: Remove the Minimal Configuration Startup Flag

  • Open SQL Server Configuration Manager.
  • Go to SQL Server Services > [Your Instance] > Properties > Startup Parameters.
  • Select the -f parameter and click Remove.
  • Click Apply, then restart the SQL Server service for changes to take effect:
  Restart-Service -Name 'MSSQLSERVER'

Step 3: Restart SQL Server in Normal Mode

  • Verify the service has restarted successfully using:
  Get-Service -Name 'MSSQLSERVER'
  • Confirm the instance is no longer in minimal configuration mode by re-running:
  SELECT SERVERPROPERTY('IsSingleUser') AS IsMinimalConfig;
  • Ensure the result returns 0, indicating normal operating mode.

Step 4: Detach the Database Using Standard Procedure

  • In SQL Server Management Studio (SSMS), right-click the target database.
  • Select Tasks > Detach.
  • Alternatively, run the detach command via T-SQL:
  EXEC sp_detach_db 'YourDatabaseName';
  • Confirm there are no active connections before detaching by checking:
  SELECT * FROM sys.dm_exec_sessions WHERE database_id = DB_ID('YourDatabaseName');

Alternative or Verification Steps

  • Verification: After detaching, confirm the database no longer appears in sys.databases by running SELECT name FROM sys.databases;.
  • Alternative: If the database still won’t detach due to active sessions, set it to single-user mode first using ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE; before attempting the detach again.

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

Troubleshooting Guide: Error 3708 – Cannot Perform Action on System Object

Why This Error Happens

Error 3708 occurs when a user or application attempts to alter, drop, or modify a system object (such as a system table, system view, or system-generated constraint) that SQL Server protects by design. This typically happens when scripts written for user databases are mistakenly run against system databases (master, model, msdb), or when automated deployment/migration tools attempt schema changes without filtering out system-owned objects. It can also surface when third-party tools incorrectly enumerate objects using sys.objects without excluding is_ms_shipped = 1 entries.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Object and Context

  • Capture the full error text, including the resolved %.*ls object name, from SQL Server Error Log or SSMS output.
  • Run the following query to confirm if the object is system-owned:
SELECT name, type_desc, is_ms_shipped 
FROM sys.objects 
WHERE name = 'YourObjectNameHere';
  • If is_ms_shipped = 1, this confirms SQL Server is correctly blocking the operation.

Step 2: Review and Correct the Script or Application Logic

  • Check deployment scripts, ORM migrations (Entity Framework, Liquibase, Flyway), or DevOps pipelines for hardcoded DROP/ALTER statements targeting system tables.
  • Add explicit filtering in any dynamic SQL generation to exclude system objects:
WHERE is_ms_shipped = 0
  • Verify the script is targeting the correct database context using USE [YourDatabaseName]; rather than defaulting to master.

Step 3: Validate Permissions and Connection String Defaults

  • On Windows Server 2025/Windows 11, open SQL Server Configuration Manager and confirm the client application’s default database isn’t set to master.
  • In SSMS, check Server Properties > Connections to ensure no default database override is pointing to a system database.
  • If using a login with sysadmin rights, restrict it to only the necessary user database via Security > Logins > Properties > User Mapping.

Step 4: Rebuild or Restore the Affected Metadata (If Corruption Suspected)

  • If the system object appears damaged (unlikely but possible after improper patching), run:
DBCC CHECKDB ('master') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is confirmed in master, restore from a known-good backup or rebuild system databases using setup.exe /ACTION=REBUILDDATABASE from the SQL Server 2025 installation media.

Alternative or Verification Steps

  • Re-run the original operation against a user-created database or test object to confirm the script logic works correctly outside system boundaries.
  • If using automated tooling (SSDT, dbForge, Redgate), update to the latest build compatible with SQL Server 2025, as older filtering logic for sys.objects may not account for newly shipped system objects in this version.

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

Troubleshooting Guide: SQL Server Error 3709

Why This Error Happens

This error occurs because SQL Server maintains a dependency link between a source database and any database snapshots created from it, which rely on the original database’s data pages to resolve unmodified records. When you attempt to drop, detach, or take the source database offline, SQL Server blocks the operation because the snapshot(s) still reference the original file structure. This is a protective mechanism rather than a corruption issue, and it will persist until every dependent snapshot is explicitly removed first.

Step-by-Step Resolution Guide

Step 1: Identify All Dependent Snapshots

  • Open SQL Server Management Studio (SSMS) and connect to the instance reporting the error.
  • Run the following query to list all snapshots tied to the source database:
SELECT 
    d.name AS SnapshotName,
    d.create_date,
    sm.physical_name AS SnapshotFile,
    sd.name AS SourceDatabase
FROM sys.databases d
JOIN sys.master_files sm ON d.database_id = sm.database_id
JOIN sys.databases sd ON d.source_database_id = sd.database_id
WHERE sd.name = 'YourSourceDatabaseName';
  • Note the exact SnapshotName values returned — you will need these for the next step.

Step 2: Drop the Identified Database Snapshot(s)

  • For each snapshot name returned in Step 1, execute a DROP DATABASE command:
DROP DATABASE [YourSnapshotName];
  • If multiple snapshots exist on the same source, repeat this command for every snapshot individually; SQL Server 2025 does not support dropping multiple databases in a single statement if any are snapshots.
  • Confirm no error is returned in the Messages pane of SSMS after each drop.

Step 3: Verify No Orphaned File Locks Remain

  • On Windows Server 2025 / Windows 11, open File Explorer and navigate to the snapshot’s sparse file location (commonly C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\).
  • Ensure the .ss (snapshot sparse file) associated with the dropped snapshot no longer appears; if it does, restart the SQL Server (MSSQLSERVER) service via services.msc to release any lingering file handles.
  • Re-attempt the original operation (DROP, DETACH, or RESTORE) on the source database.

Step 4: Re-Run the Original Database Operation

  • Execute your original intended command again, for example:
DROP DATABASE [YourSourceDatabaseName];
  • Confirm the command completes without triggering Error 3709.

Alternative or Verification Steps

  • Verify the fix: Re-run the query from Step 1 — it should return zero rows, confirming no snapshots remain linked to the source database before you proceed with your original operation.
  • Alternative approach: If you cannot locate the snapshot via SSMS (e.g., it was created by a third-party backup tool), query sys.databases directly for any database where source_database_id is not NULL, as this guarantees you catch all snapshot dependencies regardless of naming conventions.

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

Troubleshooting Guide: Error 3707 – Cannot Detach a Suspect or Recovery Pending Database

Why This Error Happens

SQL Server Error 3707 occurs when a database enters a SUSPECT or RECOVERY_PENDING state due to corruption in the transaction log, missing/inaccessible data files, or an interrupted recovery process during startup. Because the database cannot complete the recovery phase (redo/undo of transactions), SQL Server blocks detach operations to prevent further data loss or an inconsistent file state. This typically stems from unexpected shutdowns, storage failures, or file permission changes on the underlying MDF/LDF files in Windows Server 2025 or Windows 11.

Step-by-Step Resolution Guide

Step 1: Verify the Database State and Collect Diagnostics

  • Run SELECT name, state_desc FROM sys.databases WHERE name = 'YourDB'; to confirm SUSPECT or RECOVERY_PENDING status.
  • Check the SQL Server Error Log (via SSMS or C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the underlying I/O or corruption error tied to Event ID 3707.
  • Confirm the physical files exist and are accessible at their configured path (e.g., D:\SQLData\YourDB.mdf and D:\SQLData\YourDB_log.ldf).

Step 2: Attempt to Bring the Database Online for Repair

  • Set the database to EMERGENCY mode: ALTER DATABASE YourDB SET EMERGENCY;
  • Switch to single-user mode: ALTER DATABASE YourDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • Run a consistency check: DBCC CHECKDB('YourDB');
  • If corruption is found, repair using: DBCC CHECKDB('YourDB', REPAIR_ALLOW_DATA_LOSS); (only after taking a file-level backup first).

Step 3: Restore from Backup Instead of Repairing (Preferred Option)

  • If a valid full or differential backup exists, restore it instead of repairing in place: RESTORE DATABASE YourDB FROM DISK = 'E:\Backups\YourDB.bak' WITH REPLACE, RECOVERY;
  • This avoids data loss associated with REPAIR_ALLOW_DATA_LOSS and is the Microsoft-recommended path for production systems.

Step 4: Return the Database to Multi-User Mode

  • Once repaired or restored, run: ALTER DATABASE YourDB SET MULTI_USER;
  • Confirm the database state returns to ONLINE: SELECT state_desc FROM sys.databases WHERE name = 'YourDB';

Step 5: Detach the Database (If Still Required)

  • Only after the database shows ONLINE status, run: EXEC sp_detach_db 'YourDB', 'true';
  • If detach is no longer necessary, skip this step since the database is now functional.

Alternative or Verification Steps

  • Verify the fix by querying sys.databases to confirm state_desc = 'ONLINE' and by running DBCC CHECKDB('YourDB') WITH NO_INFOMSGS; to ensure zero allocation or consistency errors remain.
  • If repair and restore both fail due to severe corruption, drop the database (DROP DATABASE YourDB;) and perform a full restore onto a new database instance from the last known good backup.

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

Troubleshooting Guide: Error 3706 — “Cannot %S_MSG a Database Snapshot”

Why This Error Happens

Error 3706 occurs when SQL Server attempts to perform an operation (such as ATTACH, BACKUP, RESTORE, or ALTER) against a database snapshot that does not support that action, since snapshots are read-only, point-in-time views and not standalone databases. This typically happens because the sparse file backing the snapshot is missing, corrupted, or has been moved from its original path, breaking the link between the snapshot metadata and its underlying NTFS sparse file. It can also occur if a user or application mistakenly targets a snapshot name instead of the source database when issuing a management command.

Step-by-Step Resolution Guide

Step 1: Identify the Operation and Target Causing the Error

  • Check the exact error message in SQL Server Error Log or Event Viewer (Windows Logs > Application) to see which command (BACKUP, RESTORE, DETACH, ALTER, etc.) triggered the %S_MSG placeholder.
  • Run SELECT name, source_database_id, create_date FROM sys.databases WHERE source_database_id IS NOT NULL; to confirm whether the target is indeed a snapshot.
  • Confirm the operation (e.g., backup or schema change) was not mistakenly pointed at the snapshot instead of the live source database.

Step 2: Verify the Snapshot’s Underlying Sparse File Integrity

  • Navigate to the snapshot file location, typically under C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\.
  • Confirm the .ss sparse file still exists and has not been renamed, deleted, or relocated outside SQL Server’s control.
  • Use sys.master_files to cross-reference the expected physical path: SELECT name, physical_name FROM sys.master_files WHERE database_id = DB_ID('YourSnapshotName');

Step 3: Drop and Recreate the Corrupted or Orphaned Snapshot

  • If the sparse file is missing or inaccessible, the snapshot cannot be repaired — it must be dropped: DROP DATABASE YourSnapshotName;
  • Recreate the snapshot against the live source database using:
    CREATE DATABASE YourSnapshotName ON (NAME = YourDB, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\YourDB_Snap.ss') AS SNAPSHOT OF YourDB;
  • Ensure the SQL Server service account has read/write permissions on the target data directory.

Step 4: Redirect the Unsupported Command to the Correct Database

  • If the error was triggered by attempting BACKUP, DETACH, or ALTER against the snapshot itself, reissue the command against the actual source database name instead.
  • Update any SQL Agent Jobs, maintenance plans, or scripts that may have hardcoded the snapshot name incorrectly.

Alternative or Verification Steps

  • Verify the fix by querying sys.databases to confirm the snapshot shows state_desc = 'ONLINE' and successfully responds to a read-only SELECT query.
  • If snapshots continue to fail, check disk space on the volume hosting the sparse file (.ss) — NTFS sparse files can silently fail to grow if the volume is near capacity, causing repeated 3706 errors.

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

Troubleshooting Guide: SQL Server Error 3705

Why This Error Happens

Error 3705 occurs when a DROP statement is executed against an object using the wrong object-type keyword—for example, attempting to run DROP TABLE on an object that is actually a VIEW, or DROP PROCEDURE on an object that is actually a FUNCTION. SQL Server’s metadata engine validates the object type stored in sys.objects against the keyword used in the DROP statement, and a mismatch triggers this error before any schema modification occurs. This is typically caused by schema drift, incorrect deployment scripts, or confusion between similarly named objects created by different teams or automated CI/CD pipelines.

Step-by-Step Resolution Guide

Step 1: Identify the Actual Object Type

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio connected to the affected instance on Windows Server 2025 / Windows 11.
  • Run the following query to confirm the real type of the object referenced in the error message:
  SELECT name, type, type_desc 
  FROM sys.objects 
  WHERE name = 'YourObjectName';
  • Cross-reference type_desc (e.g., VIEW, SQL_STORED_PROCEDURE, SQL_SCALAR_FUNCTION) with the keyword used in your original DROP statement.

Step 2: Correct the DROP Statement Syntax

  • Replace the incorrect keyword with the one matching the type_desc output from Step 1.
  • Common corrections:
  • Use DROP VIEW instead of DROP TABLE for views.
  • Use DROP FUNCTION instead of DROP PROCEDURE for scalar or table-valued functions.
  • Use DROP PROCEDURE instead of DROP FUNCTION for stored procedures.
  • Re-run the corrected statement in a new query window to confirm it executes without error.

Step 3: Audit and Fix Deployment/Migration Scripts

  • Search your source-controlled .sql deployment scripts (e.g., in DevOps repos or SSDT projects) for the offending DROP statement using a text search tool like grep or VS Code’s “Find in Files.”
  • Update the script to use the correct object-type keyword, and add a pre-check using OBJECTPROPERTY() to future-proof the script:
  IF OBJECTPROPERTY(OBJECT_ID('YourObjectName'), 'IsView') = 1
      DROP VIEW YourObjectName;
  • Commit and redeploy the corrected script through your standard CI/CD pipeline.

Step 4: Check for Naming Collisions Across Schemas

  • Verify there isn’t a duplicate object name across different schemas (e.g., dbo.MyObject vs sales.MyObject) causing confusion in the script.
  • Run:
  SELECT s.name AS SchemaName, o.name, o.type_desc
  FROM sys.objects o
  JOIN sys.schemas s ON o.schema_id = s.schema_id
  WHERE o.name = 'YourObjectName';
  • Fully qualify the object name with its schema in the corrected DROP statement to avoid ambiguity.

Alternative or Verification Steps

  • Verify the fix by re-running the corrected DROP statement in a test/staging environment first; confirm no Error 3705 is returned and the object is removed from sys.objects.
  • If the error persists, check for synonyms (sys.synonyms) pointing to the object under a different name, as DROP statements cannot target a synonym’s underlying object type directly—drop the synonym separately using DROP SYNONYM.

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

Troubleshooting Guide: Error 3702 – “Cannot Drop Database Because It Is Currently In Use”

Why This Error Happens

This error occurs because SQL Server 2025 prevents dropping a database while one or more active connections, sessions, or processes still hold a reference to it. Common causes include open query windows in SQL Server Management Studio (SSMS), active application connection pools, lingering replication or mirroring configurations, or background processes like SQL Server Agent jobs still accessing the database. The database engine enforces this lock to prevent data corruption that could result from removing a database mid-transaction.

Step-by-Step Resolution Guide

Step 1: Identify Active Connections to the Database

  • Open a new query window in SSMS (ensure it’s not connected to the target database itself).
  • Run the following command to list all active sessions:
  SELECT session_id, login_name, host_name, program_name, status
  FROM sys.dm_exec_sessions
  WHERE database_id = DB_ID('YourDatabaseName');
  • Note any session_id values returned, as these represent active connections blocking the drop operation.

Step 2: Terminate Active Sessions

  • Kill each blocking session individually using the KILL command:
  KILL <session_id>;
  • Alternatively, force the database into single-user mode to automatically disconnect all other sessions:
  ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • This rolls back any open transactions and immediately disconnects all non-essential users.

Step 3: Check for Lingering OS-Level Locks (Windows Server 2025 / Windows 11)

  • Open Resource Monitor (resmon.exe) and check the CPU tab under “Associated Handles” for sqlservr.exe holding file locks on the .mdf/.ldf files.
  • Restart the SQL Server Agent service via services.msc if a scheduled job is actively querying the database.
  • Verify no backup software (e.g., Windows Server Backup or third-party agents) is currently reading the database files.

Step 4: Drop the Database

  • Once the database is in single-user mode and confirmed idle, execute:
  DROP DATABASE YourDatabaseName;
  • If the command still fails, restart the SQL Server service via services.msc (service name: MSSQLSERVER or your named instance) and immediately retry the drop command before new connections can establish.

Alternative or Verification Steps

  • Verify the fix: Re-run SELECT name FROM sys.databases WHERE name = 'YourDatabaseName'; — if it returns zero rows, the database has been successfully dropped.
  • Alternative method: If the GUI-based drop in SSMS fails, right-click the database → Tasks → Take Offline, then delete the database using Object Explorer, which often bypasses lingering session locks that command-line methods cannot clear.

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

Troubleshooting Guide: Error 3703 – Cannot Detach Database Because It Is Currently in Use

Why This Error Happens

Error 3703 occurs when SQL Server 2025 cannot detach a database because one or more active connections, open transactions, or processes are still referencing it. This commonly happens when applications maintain pooled connections that remain open even when idle, or when SQL Server Management Studio (SSMS) itself has an active query window pointed at the target database. Background processes such as Full-Text indexing, Replication, Mirroring, or the Query Store can also hold locks that prevent a clean detach operation.

Step-by-Step Resolution Guide

Step 1: Identify Active Connections to the Database

  • Open a new query window in SSMS connected to the master database (not the database you are trying to detach).
  • Run the following command to view active sessions: SELECT spid, status, hostname, program_name, loginame FROM sys.sysprocesses WHERE dbid = DB_ID('YourDatabaseName');
  • Note the spid (Session Process ID) values returned, as these represent the blocking connections.

Step 2: Force Single-User Mode to Clear Connections

  • Switch the database context to force out all other users before attempting the detach.
  • Execute: ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • This command immediately terminates all other transactions and connections to the specified database, rolling back any incomplete work.

Step 3: Disable Background Services and Retry Detach

  • Check if Full-Text Search or Replication is enabled on the database, as these background services often ignore standard connection kills.
  • Run sp_fulltext_database 'disable'; if Full-Text catalogs are present on the database.
  • Attempt the detach again using the stored procedure: EXEC sp_detach_db 'YourDatabaseName', 'true';

Step 4: Restart the SQL Server Service (If Needed)

  • If the lock persists after the above steps, specific system processes (like a hung backup job) may be holding the file handle at the OS level.
  • Open Services.msc on your Windows Server 2025 or Windows 11 machine.
  • Locate SQL Server (MSSQLSERVER), right-click, and select Restart to release any OS-level file locks.
  • Immediately re-run the sp_detach_db command before new connections can be established.

Alternative or Verification Steps

  • Verification: After running the detach command successfully, refresh the Databases folder in SSMS Object Explorer to confirm the database no longer appears in the list.
  • Alternative: If detaching is still blocked, use the GUI method instead: Right-click the database in SSMS, select Tasks > Detach, and check the “Drop Connections” checkbox in the dialog box before clicking OK.

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

Why This Error Happens

Error 3701 occurs when SQL Server 2025 cannot complete a DROP, ALTER, or similar DDL operation because the target object (table, view, procedure, or database) is either currently in use by an active session, protected by a schema-bound dependency, or does not exist under the specified name/schema. This is commonly triggered by open transactions holding locks on the object, views or functions created with SCHEMABINDING that reference the object, or a mismatch between the object owner/schema and the one specified in the command. In rare cases, metadata corruption in the system catalog views can also cause SQL Server to report this error even when the object appears to exist.

Step-by-Step Resolution Guide

Step 1: Identify Active Sessions and Locks on the Object

  • Run sp_who2 or query sys.dm_exec_requests and sys.dm_tran_locks to check if another session is holding a lock on the object.
  • Use the following query to find blocking sessions:
  SELECT request_session_id, resource_type, resource_description 
  FROM sys.dm_tran_locks 
  WHERE resource_database_id = DB_ID('YourDatabaseName');
  • Kill the blocking session if safe to do so using KILL <session_id>.

Step 2: Check for Schema-Bound Dependencies

  • Query sys.sql_expression_dependencies to find views, functions, or procedures that reference the object with SCHEMABINDING.
  SELECT referencing_entity_name 
  FROM sys.sql_expression_dependencies 
  WHERE referenced_entity_name = 'YourObjectName';
  • Drop or ALTER the dependent schema-bound objects first (remove WITH SCHEMABINDING temporarily), then retry your original command.

Step 3: Verify Object Ownership and Schema Name

  • Confirm the exact schema the object lives in using:
  SELECT s.name AS SchemaName, o.name AS ObjectName 
  FROM sys.objects o 
  JOIN sys.schemas s ON o.schema_id = s.schema_id 
  WHERE o.name = 'YourObjectName';
  • Reissue the DDL command using the fully qualified name (e.g., dbo.YourTable instead of just YourTable).

Step 4: Restart the Target Session or SQL Server Service (If Locks Persist)

  • On Windows Server 2025, open Services.msc, locate SQL Server (MSSQLSERVER), and restart the service if orphaned transactions are not releasing locks.
  • Alternatively, restart via PowerShell:
  Restart-Service -Name 'MSSQLSERVER' -Force

Step 5: Repair Catalog Metadata (If Corruption Is Suspected)

  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to check for corruption in the system catalog.
  • If errors are found, restore from the last known good backup rather than attempting a repair that allows data loss.

Alternative or Verification Steps

  • After applying fixes, re-run the original DDL statement in SQL Server Management Studio (SSMS) and confirm it completes without Error 3701.
  • As an alternative, script out the object definition using the Generate Scripts wizard in SSMS, drop all dependencies manually in the correct order, then recreate the object and its dependents from scratch.

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

Troubleshooting Guide: SQL Server Error 3697 – Batch Waits Statistics

Why This Error Happens

Error 3697 is typically an informational/diagnostic message raised internally by the SQL Server Query Processor when it logs batch-level wait statistics (%ls is a placeholder for the specific wait type and duration data). This usually surfaces when a query batch encounters significant resource contention—such as CXPACKET, PAGEIOLATCH, or RESOURCE_SEMAPHORE waits—and the Extended Events or trace flag diagnostics are configured to capture batch-level wait telemetry. In Microsoft SQL Server 2025, this can also occur if the Query Store diagnostic capture mode or a related Extended Events session is misconfigured, causing the message to be logged excessively or interpreted as an error rather than a diagnostic trace.

Step-by-Step Resolution Guide

Step 1: Identify the Triggering Extended Events Session

  • Open SQL Server Management Studio (SSMS) and connect to the instance.
  • Run the following query to check active sessions capturing wait stats:
  SELECT * FROM sys.dm_xe_sessions WHERE name LIKE '%wait%';
  • Confirm whether sql_batch_completed or wait_info events are bound to a custom session logging to the error log.

Step 2: Review and Adjust Trace Flags

  • Check if Trace Flag 3697 or related diagnostic flags (e.g., 8666, 3604) are enabled at startup.
  • Run:
  DBCC TRACESTATUS(-1);
  • If found active unintentionally, disable it:
  DBCC TRACEOFF (3697, -1);
  • Remove the flag from SQL Server startup parameters via SQL Server Configuration Manager (Start → SQL Server 2025 Configuration Manager → SQL Server Services → Properties → Startup Parameters).

Step 3: Update SQL Server 2025 Cumulative Update

  • Navigate to Microsoft Update Catalog and confirm the instance is on the latest Cumulative Update (CU) for SQL Server 2025, as early builds have known false-positive logging bugs for Error 3697.
  • Apply the update and restart the SQL Server service via:
  Restart-Service -Name 'MSSQLSERVER' -Force

Step 4: Validate Resource Governor and Query Store Settings

  • Open Object Explorer → Databases → [YourDB] → Query Store → Properties.
  • Ensure “Capture Mode” is not set to ALL in high-transaction environments, as this increases batch-wait logging overhead.
  • Set to AUTO to reduce unnecessary diagnostic writes:
  ALTER DATABASE [YourDB] SET QUERY_STORE (OPERATION_MODE = READ_WRITE, QUERY_CAPTURE_MODE = AUTO);

Step 5: Check Windows Server Event Viewer for Correlated I/O Errors

  • Open Event Viewer (eventvwr.msc) on Windows Server 2025 / Windows 11.
  • Navigate to Windows Logs → Application and filter by Source: MSSQLSERVER.
  • Cross-reference timestamps with disk or storage subsystem warnings (Event ID 153 or 129), as underlying I/O latency often triggers the batch wait logging.

Alternative or Verification Steps

  • Verify the fix: Re-run representative workloads and monitor sys.dm_exec_query_stats and the SQL Server Error Log for recurrence of message 3697; absence of the log entry over a 24-hour monitoring window confirms resolution.
  • Alternative: If the error persists, isolate the issue by running sp_configure 'show advanced options', 1 and temporarily disabling verbose diagnostic logging to confirm if the message is purely cosmetic rather than indicative of actual performance degradation.

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

Troubleshooting Guide: SQL Server Error 3696 – “Internal Error While Preparing GUID”

Why This Error Happens

Error 3696 typically occurs when SQL Server’s internal mechanism for generating or parsing a GUID (Globally Unique Identifier) encounters a corrupted system catalog entry, a mismatched collation setting, or an improperly registered CLR (Common Language Runtime) component. This can also surface when the NEWSEQUENTIALID() function or extended properties referencing a UNIQUEIDENTIFIER column fail due to incomplete metadata after a failed upgrade or migration. In some cases, insufficient permissions on system-level temporary storage (tempdb) prevent SQL Server from allocating the memory structures needed to prepare the GUID value.

Step-by-Step Resolution Guide

Step 1: Verify SQL Server Service Account Permissions

  • Open Services.msc on Windows Server 2025 / Windows 11 and locate the SQL Server (MSSQLSERVER) service.
  • Confirm the service account has Full Control on the tempdb data/log file directories (default: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA).
  • Restart the SQL Server service after applying permission changes using net stop MSSQLSERVER && net start MSSQLSERVER.

Step 2: Rebuild or Repair the System Catalog

  • Run DBCC CHECKDB('master') WITH NO_INFOMSGS, ALL_ERRORMSGS; in SQL Server Management Studio (SSMS) to check for catalog corruption.
  • If corruption is found, restore the master database from a known good backup rather than attempting an in-place repair.
  • For non-critical corruption, run DBCC CHECKCATALOG('YourDatabaseName'); to isolate issues to a specific user database.

Step 3: Validate and Re-register CLR Integration

  • Check CLR status with SELECT * FROM sys.configurations WHERE name = 'clr enabled';
  • If disabled or misconfigured, re-enable it:
  EXEC sp_configure 'clr enabled', 1;
  RECONFIGURE;
  • Drop and recreate any CLR-based GUID generation assemblies using DROP ASSEMBLY followed by CREATE ASSEMBLY with the correct .dll path.

Step 4: Update SQL Server 2025 Cumulative Update

  • Navigate to Microsoft Update Catalog and download the latest Cumulative Update (CU) for SQL Server 2025.
  • Run the installer as Administrator and select the affected instance.
  • Reboot Windows Server 2025 / Windows 11 after installation completes to finalize binary replacements related to GUID handling.

Step 5: Recreate the Affected Table or Column

  • If the error is isolated to a specific table, script out the table definition using SSMS’s Generate Scripts wizard.
  • Drop the UNIQUEIDENTIFIER column and recreate it with ALTER TABLE YourTable ADD NewGUIDColumn UNIQUEIDENTIFIER DEFAULT NEWID();
  • Re-insert or migrate data from a backup table to populate the new column correctly.

Alternative or Verification Steps

  • Run a test query such as SELECT NEWID(); in a new query window to confirm GUID generation functions without triggering Error 3696.
  • If the issue persists after all steps, perform a full uninstall and clean reinstall of the SQL Server 2025 instance, ensuring the tempdb and master system databases are rebuilt from scratch using the setup.exe /ACTION=REBUILDDATABASE command.

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

Troubleshooting Guide: SQL Server Error 3646

Why This Error Happens

Error 3646 is an internal diagnostic exception raised by a low-level SQL Server utility function that is explicitly documented to “fail by throwing an exception that caller MUST catch.” This indicates that an internal caller function failed to properly catch and handle the exception before it propagated up to the user-facing session. Typically, this surfaces due to corrupted metadata caches, an outdated query optimizer module, or a transient failure in an internal binding function that was not gracefully suppressed by the calling stored procedure or extended function.

Step-by-Step Resolution Guide

Step 1: Clear Internal Caches and Restart Services

  • Open SQL Server Management Studio (SSMS) and run DBCC FREEPROCCACHE to clear the stored procedure cache, which may resolve corrupted execution plans causing the uncaught exception.
  • Follow this with DBCC FREESYSTEMCACHE('ALL') to clear all system caches.
  • Restart the SQL Server service via services.msc or by running net stop MSSQLSERVER && net start MSSQLSERVER in an elevated Command Prompt.

Step 2: Apply the Latest Cumulative Update (CU)

  • Check your current build version by running SELECT @@VERSION; in a query window.
  • Navigate to the Microsoft Update Catalog and download the latest Cumulative Update for SQL Server 2025.
  • Install the update package located typically at C:\SQLServer2025Media\Updates\ and allow the installer to restart dependent services automatically.

Step 3: Run Database Consistency Checks

  • Execute DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to rule out underlying page-level or metadata corruption.
  • If corruption is found, review the output for recommended repair levels (e.g., REPAIR_REBUILD) before proceeding, as using REPAIR_ALLOW_DATA_LOSS should be a last resort.

Step 4: Enable Trace Flags for Deeper Diagnostics

  • Add Trace Flag 3656 via SQL Server Configuration Manager under the Startup Parameters tab (e.g., -T3656) to force the engine to log the specific internal function call stack that triggered the failure.
  • Reproduce the error and check the SQL Server Error Log located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for the specific module name associated with the failure.

Alternative or Verification Steps

  • Verification: Re-run the specific query or application transaction that originally triggered the error; monitor the SQL Server Error Log for 10-15 minutes to ensure Error 3646 does not reappear in the logs.
  • Alternative: If the error persists after patching and cache clearing, restore the specific user database from the last known healthy backup to a test instance to isolate whether the issue is environmental (server-level) or specific to the database file itself.

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

Why This Error Happens

Error 3644 with the “Prefaulter task failed” message typically occurs when SQL Server 2025’s database engine attempts to pre-allocate or “pre-fault” memory pages for a data file during startup or recovery, but the underlying I/O subsystem returns an unexpected error code. This is most commonly caused by file system permission restrictions on the SQL Server service account, disk-level corruption on the volume hosting the .mdf/.ndf/.ldf files, or a conflict with antivirus/EDR software intercepting file handle operations. In rarer cases, this surfaces when the file resides on a network share or storage tier that does not fully support the sparse file or instant file initialization APIs required by the prefaulting mechanism.

Step-by-Step Resolution Guide

Step 1: Verify File and Folder Permissions

  • Open File Explorer and navigate to the SQL Server data directory (commonly C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA).
  • Right-click the affected file, go to Properties > Security, and confirm the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control.
  • If permissions are missing, run the following in an elevated PowerShell prompt:
icacls "C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\yourfile.mdf" /grant "NT SERVICE\MSSQLSERVER:(F)"

Step 2: Check Disk Health and File Integrity

  • Run chkdsk C: /f /r from an elevated Command Prompt and schedule a restart if the volume is locked.
  • Inspect the Windows Event Viewer under Windows Logs > System for Disk or Ntfs warnings correlating with the SQL error timestamp.
  • If corruption is confirmed, restore the affected database file from the most recent verified backup using RESTORE DATABASE ... WITH REPLACE.

Step 3: Exclude SQL Server Paths from Antivirus/EDR Scanning

  • Open your antivirus console (Windows Defender or third-party) and add exclusions for:
  • The SQL data directory (...\MSSQL\DATA)
  • The SQL log directory (...\MSSQL\LOG)
  • sqlservr.exe process itself
  • Restart the SQL Server (MSSQLSERVER) service via services.msc to apply changes immediately.

Step 4: Confirm Instant File Initialization (IFI) and Storage Compatibility

  • Ensure the SQL Server service account has the Perform Volume Maintenance Tasks right via secpol.msc > Local Policies > User Rights Assignment.
  • If the file resides on a network share, migrate it to local NVMe/SSD storage, as prefaulting operations are not reliably supported on all remote file systems.

Alternative or Verification Steps

  • After applying fixes, restart the SQL Server service and check the SQL Server Error Log (ERRORLOG file) for recurrence of Error 3644; also run DBCC CHECKDB on the affected database to confirm no residual corruption.
  • If the issue persists, temporarily disable instant file initialization via sp_configure and test a clean restart — if the error disappears, the root cause is confirmed to be storage/IFI related rather than permissions.

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

Troubleshooting Guide: SQL Server Error 3645 — “Batch Connectivity Statistics: Packets Read Time”

Why This Error Happens

Error 3645 typically surfaces when SQL Server’s diagnostic telemetry layer logs network latency statistics that exceed expected thresholds, often triggered by TCP/IP stack misconfiguration or NIC driver inefficiencies on the host machine. This is frequently compounded by outdated network drivers on Windows Server 2025/Windows 11 that fail to properly negotiate TCP offload settings with SQL Server 2025’s updated connectivity stack. In some cases, this is a benign informational message that becomes an error due to restrictive extended events session configurations capturing it as a critical trace event.

Step-by-Step Resolution Guide

Step 1: Verify Network Adapter Configuration and Drivers

  • Open Device Manager and locate your active network adapter under “Network Adapters.”
  • Right-click and select “Update Driver” — ensure you’re on the latest WHQL-certified driver for Windows Server 2025.
  • Disable TCP Chimney Offload if enabled, by running the following in an elevated PowerShell/Command Prompt:
  netsh int tcp set global chimney=disabled
  • Restart the network adapter or reboot the server to apply changes.

Step 2: Review and Adjust SQL Server Extended Events Session

  • Open SQL Server Management Studio (SSMS) and connect to the instance reporting the error.
  • Navigate to Management > Extended Events > Sessions.
  • Locate the session capturing batch_connectivity_statistics or similar network telemetry events.
  • Right-click the session, select Properties, and either disable the specific event or increase the latency threshold filter (e.g., set packets_read_time > 500ms instead of default values) to reduce noise-level logging.

Step 3: Check SQL Server Network Configuration (TCP/IP Settings)

  • Open SQL Server Configuration Manager.
  • Navigate to SQL Server Network Configuration > Protocols for [Your Instance Name].
  • Ensure TCP/IP is enabled and that the Keep Alive value under IP Addresses tab is set appropriately (default is 30000 ms; consider increasing to 60000 ms on high-latency networks).
  • Restart the SQL Server service via services.msc or by running:
  net stop MSSQLSERVER && net start MSSQLSERVER

Step 4: Apply Latest SQL Server 2025 Cumulative Update

  • Check your current build version by running:
  SELECT @@VERSION;
  • Download and install the latest Cumulative Update (CU) from the Microsoft Update Catalog if your build is not current.
  • Reboot the server post-installation to ensure all binaries are properly replaced.

Alternative or Verification Steps

  • After applying the fixes, run a connectivity stress test using sqlcmd -S servername -Q "SELECT 1" in a loop and monitor the SQL Error Log (C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log\ERRORLOG) to confirm Error 3645 no longer appears.
  • If the error persists, consider isolating the issue by testing connectivity over a different network path (e.g., switching from a virtual NIC to a physical NIC) to rule out hypervisor-level packet inspection delays.

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

Troubleshooting Guide: Error 3643 in Microsoft SQL Server 2025

Why This Error Happens

Error 3643 occurs when a query, backup, restore, or maintenance operation exceeds the time limit defined by the STATEMENT_TIMEOUT session setting, a query governor configuration, or an explicit WITH TIMEOUT clause used in BACKUP/RESTORE statements. This is typically triggered by long-running operations on large databases, blocking from other transactions, insufficient hardware resources (I/O or CPU bottlenecks), or an administrator setting an unrealistically low timeout threshold. SQL Server deliberately halts the operation to prevent indefinite resource consumption once the configured ceiling is reached.

Step-by-Step Resolution Guide

Step 1: Identify the Source of the Timeout Setting

  • Open SQL Server Management Studio (SSMS) and connect to the instance via Object Explorer.
  • Right-click the server, select Properties > Connections, and check the Default connection options for any non-zero value under “query governor cost limit.”
  • Run SELECT @@OPTIONS or check session-level settings using DBCC USEROPTIONS to confirm if STATEMENT_TIMEOUT is active for the session.
  • If using BACKUP/RESTORE, inspect the script for a WITH TIMEOUT = n clause (where n is in seconds).

Step 2: Adjust or Remove the Timeout Threshold

  • In SSMS, navigate to Tools > Options > Query Execution > SQL Server > General.
  • Increase the “Execution time-out” value (in seconds) or set it to 0 for unlimited execution time.
  • For T-SQL sessions, run the following command before executing the long operation:
  SET STATEMENT_TIMEOUT = 0;
  • If using a backup script, remove the WITH TIMEOUT clause entirely or increase the numeric value (e.g., WITH TIMEOUT = 600).

Step 3: Resolve Underlying Performance Bottlenecks

  • Open Windows Server 2025 Performance Monitor (perfmon.exe) and add counters for Avg. Disk sec/Read, Avg. Disk sec/Write, and % Processor Time.
  • Check for blocking sessions in SQL Server using:
  SELECT * FROM sys.dm_exec_requests WHERE blocking_session_id <> 0;
  • If disk I/O latency is high, move the database files (.mdf/.ldf) to faster storage (NVMe/SSD) via Database Properties > Files.
  • Update storage drivers through Device Manager on Windows Server 2025 to rule out firmware-level I/O delays.

Step 4: Restart SQL Server Services to Clear Hung Processes

  • Open the Services console (services.msc) on Windows Server 2025 / Windows 11.
  • Locate SQL Server (MSSQLSERVER) or the named instance, right-click, and select Restart.
  • Re-run the operation immediately after the service restarts to confirm the timeout threshold is no longer being hit prematurely due to resource contention.

Alternative or Verification Steps

  • Re-execute the original failing query or backup/restore job and confirm it completes without triggering Error 3643; monitor the duration against the new timeout value.
  • If the error persists despite configuration changes, check the SQL Server Error Log (via SSMS > Management > SQL Server Logs) for correlating I/O warnings or deadlock entries that may indicate a deeper hardware or locking issue requiring a DBA review.

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

Troubleshooting Guide: SQL Server Error 3642 — “Table ‘%.*ls’. Segment reads %u”

Why This Error Happens

Error 3642 is raised during columnstore index operations (typically DBCC CHECKDB or backup verification) when SQL Server detects a mismatch between the expected and actual number of segment reads for a columnstore table. This usually indicates physical corruption in the columnstore segments, often caused by abrupt storage-level failures, improper shutdowns during write operations, or underlying disk/IO subsystem errors on the Windows Server 2025 host. It can also surface after a failed or interrupted ALTER INDEX REORGANIZE operation on a clustered columnstore index.

Step-by-Step Resolution Guide

Step 1: Confirm the Scope of Corruption

  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; from SQL Server Management Studio (SSMS) or sqlcmd.
  • Note the specific table name returned in the error message (replacing %.*ls) and the segment count value (%u).
  • Check the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for correlating IO or storage warnings around the same timestamp.

Step 2: Validate Underlying Storage Health

  • Open Event Viewer on Windows Server 2025 and inspect Windows Logs > System for Disk, NTFS, or Storport errors.
  • Run chkdsk D:\ /f /r (replace D:\ with your actual data drive) during a maintenance window to repair file-system-level issues.
  • Verify the storage controller drivers and firmware are current via Device Manager or the vendor’s management utility.

Step 3: Rebuild the Affected Columnstore Index

  • In SSMS, execute: ALTER INDEX [YourColumnstoreIndexName] ON [dbo].[YourTableName] REBUILD;
  • If the table uses a nonclustered columnstore index, rebuild only that specific index rather than the whole table.
  • Monitor tempdb usage during the rebuild, as large columnstore rebuilds can require significant temporary space.

Step 4: Restore From a Known-Good Backup (If Rebuild Fails)

  • If the index rebuild fails with further errors, restore the affected database from the last verified clean backup using RESTORE DATABASE YourDatabaseName FROM DISK = 'E:\Backups\YourDatabaseName.bak' WITH REPLACE;
  • Apply any subsequent transaction log backups to minimize data loss.
  • Re-run DBCC CHECKDB immediately after restore to confirm integrity before bringing the database back online for production use.

Step 5: Apply Latest SQL Server 2025 Cumulative Update

  • Download and install the latest Cumulative Update (CU) for SQL Server 2025 from the Microsoft Update Catalog, as columnstore segment-handling bugs are periodically patched.
  • Restart the SQL Server service via SQL Server Configuration Manager after installation.

Alternative or Verification Steps

  • After remediation, re-run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; and confirm it returns zero allocation or consistency errors.
  • If error 3642 recurs on the same table shortly after rebuild, consider dropping and recreating the columnstore index entirely (DROP INDEX followed by CREATE COLUMNSTORE INDEX) rather than relying on REBUILD, as this forces a full data re-segmentation.

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

Troubleshooting Guide: SQL Server Error 3641 (“Total logical reads %lu…”)

Why This Error Happens

Error 3641 is typically a statistics/informational message rather than a critical failure, often appended to the output of STATISTICS IO or DBCC commands when displaying query performance metrics such as logical reads, physical reads, and read-ahead reads. In SQL Server 2025 running on Windows Server 2025 or Windows 11, this message can appear unexpectedly in logs or client output when verbose diagnostic logging is enabled, when a corrupted statistics cache causes malformed output formatting, or when trace flags (such as 3604 or 3605) redirect diagnostic output incorrectly. In rarer cases, it surfaces alongside I/O subsystem stress, where delayed reads from a misconfigured storage path (SAN/NVMe passthrough) cause the message buffer to flush improperly.

Step-by-Step Resolution Guide

Step 1: Verify the Context of the Message

  • Open SQL Server Management Studio (SSMS) and re-run the query with SET STATISTICS IO ON; to confirm whether this is expected diagnostic output rather than a true error.
  • Check the SQL Server Error Log at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for surrounding context (timestamps, session ID, and preceding warnings).

Step 2: Disable Conflicting Trace Flags

  • Run DBCC TRACESTATUS(-1); to list all active trace flags on the instance.
  • If flags like 3604 or 3605 are active unintentionally, disable them using:
  DBCC TRACEOFF (3604, -1);
  DBCC TRACEOFF (3605, -1);
  • Restart the SQL Server service via Services.msc or net stop MSSQLSERVER && net start MSSQLSERVER to ensure flags aren’t re-applied at startup via -T startup parameters in SQL Server Configuration Manager.

Step 3: Rebuild Statistics and Check for Corruption

  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to rule out underlying corruption causing malformed message output.
  • Update statistics using EXEC sp_updatestats; to refresh the metadata driving the logical reads calculation.
  • Ensure Windows Server 2025 storage drivers (particularly NVMe/Storage Spaces Direct drivers) are updated via Windows Update or vendor-specific driver packages to rule out I/O layer interference.

Step 4: Validate SQL Server Configuration Manager Settings

  • Open SQL Server Configuration Manager → SQL Server Services → Right-click SQL Server (MSSQLSERVER) → Properties → Startup Parameters.
  • Remove any stray -T3641 or unofficial trace flag parameters that may be forcing this output on every session.

Alternative or Verification Steps

  • Verify the fix by re-executing the original query with SET STATISTICS IO, TIME ON; — the output should now cleanly display logical reads without the error wrapper, confirming it was a diagnostic/trace flag issue rather than a system fault.
  • Alternative solution: If the message persists, apply the latest SQL Server 2025 Cumulative Update (CU) via Microsoft Update Catalog, as this specific formatting issue may be tied to a known display bug in the I/O statistics module on cross-compatible Windows 11/Server 2025 builds.

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

Troubleshooting Guide: SQL Server Error 3636

Why This Error Happens

Error 3636 occurs when SQL Server’s storage engine encounters an inconsistency while reading or writing file metadata for a specific database and file ID combination, typically pointing to on-disk corruption at the page or allocation map level. This can be triggered by abrupt power loss, faulty storage hardware, antivirus software locking database files mid-transaction, or a mismatch between the metadata cache and the actual file state after an improper shutdown. In some cases, insufficient NTFS permissions on the SQL Server service account can also prevent proper metadata validation during file access.

Step-by-Step Resolution Guide

Step 1: Verify Database and File Integrity

  • Open SQL Server Management Studio (SSMS) and run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to identify the scope of corruption.
  • Cross-reference the file ID in the error message using SELECT file_id, name, physical_name FROM sys.master_files WHERE database_id = DB_ID('YourDatabaseName');
  • Check the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for accompanying I/O or page-checksum errors.

Step 2: Rule Out Storage and Permission Issues

  • Confirm the SQL Server service account has full read/write permissions on the data/log file directory (typically D:\SQLData\ or D:\SQLLogs\).
  • Open Windows Event Viewer and check the System log for Disk or NTFS warnings correlating with the error timestamp.
  • Temporarily disable real-time antivirus scanning on the .mdf, .ndf, and .ldf file paths to rule out file-locking conflicts.

Step 3: Repair or Restore the Affected Database

  • If DBCC CHECKDB reports allocation errors, run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, REPAIR_ALLOW_DATA_LOSS; only after taking a full backup, since this option may discard corrupted data.
  • If a clean backup exists, prefer restoring from the last known-good full backup plus transaction log backups instead of running repair.
  • Take the database offline first with ALTER DATABASE YourDatabaseName SET OFFLINE; before attempting file-level repairs, then bring it back ONLINE.

Step 4: Patch and Restart SQL Server Services

  • Ensure SQL Server 2025 is updated with the latest Cumulative Update (CU) via SQL Server Setup > Maintenance, since file-metadata handling bugs are periodically patched.
  • Restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER to clear any stale in-memory metadata cache.

Alternative or Verification Steps

  • After remediation, re-run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS; and confirm it returns zero allocation or consistency errors, then monitor the ERRORLOG for 24-48 hours to ensure Error 3636 does not recur.
  • If corruption persists after repair, restore the entire database from the most recent verified backup set onto a healthy disk volume as a fallback rather than continuing to repair in place.

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

Troubleshooting Guide: Error 3637 — Parallel Operation Cannot Be Started from a DAC Connection

Why This Error Happens

Error 3637 occurs because the Dedicated Administrator Connection (DAC) in SQL Server 2025 is intentionally restricted to a single-threaded, serial execution context to guarantee administrators can always connect and diagnose a server even under severe resource pressure. When a query submitted through the DAC requires a parallel execution plan (due to MAXDOP settings, query complexity, or Resource Governor workload group configuration), the engine blocks it rather than allowing parallelism on this restricted connection. This typically surfaces when a DBA runs complex diagnostic queries, large joins, or maintenance scripts directly over the DAC port (1434 or dynamically assigned) instead of a standard connection.

Step-by-Step Resolution Guide

Step 1: Force a Serial Execution Plan on the Query

  • Add the query hint OPTION (MAXDOP 1) to the end of the problematic statement before executing it via DAC.
  • Example: SELECT * FROM sys.dm_exec_requests OPTION (MAXDOP 1);
  • This is the fastest fix and requires no server configuration changes.

Step 2: Verify and Adjust the Server-Level MAXDOP Setting

  • Open SQL Server Management Studio (SSMS) and connect via a normal (non-DAC) connection.
  • Run EXEC sp_configure 'max degree of parallelism'; to check the current value.
  • If it is set higher than 1 and DAC queries continue triggering parallel plans, consider setting a Resource Governor workgroup specifically for DAC sessions with MAX_DOP = 1.
  • Apply changes with RECONFIGURE;.

Step 3: Check Resource Governor Classification for DAC Sessions

  • Navigate to Management > Resource Governor in SSMS Object Explorer on the instance.
  • Confirm the DAC connection is not being misclassified into a workload group that permits parallelism.
  • If using a classifier function, inspect its logic located under Resource Governor > Classifier Function Name and ensure DAC logins route to the default group with MAX_DOP explicitly set to 1.
  • Run ALTER WORKLOAD GROUP [groupname] WITH (MAX_DOP = 1); ALTER RESOURCE GOVERNOR RECONFIGURE; if adjustments are needed.

Step 4: Restart the SQL Server Service to Clear Cached Plans (If Needed)

  • Open Services.msc on Windows Server 2025 / Windows 11.
  • Locate SQL Server (MSSQLSERVER) or the named instance service.
  • Right-click and select Restart to clear any cached execution plans that may still force parallelism.
  • Alternatively, run DBCC FREEPROCCACHE; from a standard connection to avoid a full restart.

Step 5: Reconnect via DAC and Re-Test the Query

  • Use the syntax sqlcmd -S ADMIN:ServerName -U sa -P password from Command Prompt to re-establish the DAC session.
  • Re-run the original diagnostic or maintenance query and confirm Error 3637 no longer appears.

Alternative or Verification Steps

  • Verify the fix by querying sys.dm_exec_query_stats or re-running the original failing script through the DAC connection — it should now complete without error 3637.
  • If the issue persists, run the query through a standard SSMS connection instead of DAC, since DAC should only be used for lightweight diagnostics, not heavy parallel workloads.

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

Troubleshooting Guide: SQL Server Error 3635 – “An error occurred while processing ‘%ls’ metadata for database id %d”

Why This Error Happens

Error 3635 typically occurs when SQL Server 2025 encounters inconsistencies while reading internal metadata structures, often triggered by corrupted system catalog views, interrupted DDL operations, or incomplete database upgrade processes. This can also surface when memory-optimized filegroup metadata becomes desynchronized from the actual database schema, particularly after an improper shutdown or failed restore operation. In some cases, insufficient permissions on system metadata tables during a schema validation pass can also trigger this error.

Step-by-Step Resolution Guide

Step 1: Run Database Consistency Checks

  • Open SQL Server Management Studio (SSMS) or use sqlcmd on Windows Server 2025.
  • Execute DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for corruption flags tied to the database ID referenced in the error message.
  • If corruption is found, note the specific object IDs for targeted repair.

Step 2: Validate and Repair System Metadata

  • Run DBCC CHECKCATALOG ('YourDatabaseName'); to confirm catalog consistency.
  • If the metadata issue is tied to memory-optimized tables, check the filegroup container at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Data\XTP\
  • If damage is confirmed, use DBCC CHECKDB ('YourDatabaseName') WITH REPAIR_ALLOW_DATA_LOSS; only after taking a full backup, as this is a destructive operation.

Step 3: Verify Permissions and Service Account Rights

  • Open Services.msc on Windows Server 2025 and confirm the SQL Server service account has full control over the data directory (typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\).
  • Ensure the account is a member of the db_owner role for the affected database.
  • Restart the SQL Server service via Restart-Service MSSQLSERVER in PowerShell (run as Administrator).

Step 4: Restore From a Known Good Backup (If Corruption Persists)

  • If repair steps fail, restore the database from the last verified clean backup using RESTORE DATABASE YourDatabaseName FROM DISK = 'D:\Backups\YourDatabaseName.bak' WITH REPLACE;
  • Re-apply any transaction logs taken after the backup to minimize data loss.

Alternative or Verification Steps

  • After applying fixes, re-run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; and confirm zero allocation or consistency errors are returned.
  • If the error persists across multiple databases, check the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for correlating I/O or storage subsystem failures, and run chkdsk on the underlying Windows Server 2025 volume.

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

Troubleshooting Guide: SQL Server Error 3634

Why This Error Happens

Error 3634 occurs when SQL Server’s Database Engine attempts a file system operation—such as creating, writing to, or accessing a backup, data, or log file—and the underlying Windows operating system rejects the request. This is most commonly caused by insufficient NTFS permissions for the SQL Server service account, a locked or corrupted file, a full disk volume, or restrictive security software (antivirus/EDR) intercepting the file handle. Because the error message is a generic wrapper around a raw OS-level error code, the exact cause depends on the specific %ls values returned in the SQL Server error log.

Step-by-Step Resolution Guide

Step 1: Identify the Exact OS Error and File Path

  • Open the SQL Server Error Log (via SSMS > Management > SQL Server Logs, or the ERRORLOG file in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\) to find the fully expanded message.
  • Note the specific Windows error code (e.g., “Access is denied,” “The system cannot find the file specified,” or “There is not enough space on the disk”).
  • Identify the exact file path and operation (e.g., CREATE FILE, BACKUP, or FlushFileBuffers) mentioned in the log.

Step 2: Verify NTFS Permissions and Service Account Rights

  • Right-click the target folder (e.g., the DATA or Backup directory) and go to Properties > Security.
  • Ensure the SQL Server service account (visible in SQL Server Configuration Manager under the “Log On As” column) has Full Control over the specific folder.
  • Run the following command in an elevated PowerShell prompt to grant permissions if missing:
icacls "D:\SQLData" /grant "NT SERVICE\MSSQLSERVER:(OI)(CI)F" /T

Step 3: Check Disk Space and File Locks

  • Verify the destination drive has sufficient free space using Get-PSDrive in PowerShell; SQL Server requires available space for both the data file and the transaction log during write operations.
  • Use Resource Monitor (resmon.exe) to check if another process (like a third-party backup tool or antivirus) has placed an exclusive lock on the .mdf, .ldf, or .bak file.
  • Restart the “SQL Server (MSSQLSERVER)” service via SQL Server Configuration Manager to release any stale handles if a lock is found.

Step 4: Exclude SQL Server Directories from Antivirus/EDR Scanning

  • Navigate to your Windows Security or third-party antivirus settings.
  • Add exclusions for the SQL Server executable (sqlservr.exe) and all data/log directories to prevent real-time scanning from intercepting file I/O operations mid-write.
  • Reboot the Windows Server 2025 instance if exclusions do not take effect on the SQL Server service immediately.

Alternative or Verification Steps

  • To verify the fix, attempt to manually run the failed operation again (e.g., execute a BACKUP DATABASE command or restart the SQL Server service) and check the Error Log for the absence of Event ID 3634.
  • If the error persists specifically during backups, run CHKDSK D: /F (replacing D: with your target drive) during a maintenance window to rule out underlying disk corruption as the root cause.

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

Troubleshooting Guide: SQL Server Error 3633

Why This Error Happens

Error 3633 occurs when SQL Server’s Database Engine attempts a file system operation (such as creating, opening, reading, or writing a file) and the underlying Windows operating system rejects the request. This is typically caused by insufficient NTFS permissions for the SQL Server service account, a corrupted or missing file/directory path, or the file being locked by another process (such as an antivirus scanner or backup utility). It can also surface when the target volume has run out of disk space or when the path specified exceeds the Windows MAX_PATH character limit.

Step-by-Step Resolution Guide

Step 1: Verify the File Path and Existence

  • Open the full error message and note the exact path returned in the '%hs' placeholder.
  • Confirm the folder and file actually exist using File Explorer or dir in Command Prompt.
  • Check for extremely long file paths (over 260 characters) which can trigger OS-level rejections on Windows Server 2025 / Windows 11.
  • If the path is broken or missing, recreate the directory structure or restore the file from a known good backup.

Step 2: Correct NTFS Permissions for the SQL Server Service Account

  • Open Services.msc and identify the account running the SQL Server (MSSQLSERVER) or named instance service.
  • Right-click the target folder (e.g., C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA) → Properties → Security tab.
  • Grant Full Control to the SQL Server service account (e.g., NT Service\MSSQLSERVER) and propagate permissions to subfolders and files.
  • Apply changes and restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.

Step 3: Check for File Locks from Antivirus or Backup Software

  • Temporarily disable real-time antivirus scanning on the SQL Server data, log, and backup directories.
  • Add permanent exclusions in Windows Defender (or third-party AV) for .mdf, .ldf, .ndf, and .bak file extensions using Add-MpPreference -ExclusionPath "D:\SQLData" in PowerShell.
  • Confirm no backup agent or sync tool (like OneDrive) is actively indexing or locking the SQL Server directories.

Step 4: Validate Disk Space and Volume Health

  • Run Get-PSDrive in PowerShell or check This PC to confirm the target volume has sufficient free space.
  • Run chkdsk D: /f (replace D: with the relevant drive) during a maintenance window to repair underlying disk corruption.
  • Review Windows Event Viewer under Windows Logs → System for related disk or NTFS warnings (Event ID 7 or 55).

Step 5: Review SQL Server Error Log for Underlying OS Error Code

  • Open the SQL Server Error Log via SSMS (Management → SQL Server Logs) or the log file at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Cross-reference the OS error code reported in '%ls' (e.g., “Access is denied” or “The system cannot find the path specified”) using net helpmsg <error_number> in Command Prompt.
  • Apply the targeted fix based on the specific OS error identified (permissions, missing path, or disk issue).

Alternative or Verification Steps

  • After applying fixes, restart the SQL Server service and attempt the original operation (backup, restore, or file creation) again to confirm the error no longer appears in the ERRORLOG.
  • If the issue persists, run SQL Server as a different service account temporarily (via SQL Server Configuration Manager) to isolate whether the problem is account-specific or environment-wide.

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

Troubleshooting Guide: SQL Server Error 3627 – “New Parallel Operation Cannot Be Started”

Why This Error Happens

This error occurs when the SQL Server Database Engine exhausts its available worker thread pool, typically because the max worker threads configuration is set too low for the current workload or because too many concurrent parallel queries (high DOP operations) are consuming all available threads simultaneously. On Windows Server 2025 / Windows 11 hosts with high core counts, this can also surface if the default thread calculation hasn’t scaled properly with the hardware, or if a runaway query is spawning excessive parallel threads due to a missing or outdated statistics-driven execution plan.

Step-by-Step Resolution Guide

Step 1: Verify Current Worker Thread Configuration

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Run the following query to check current settings:
  EXEC sp_configure 'show advanced options', 1;
  RECONFIGURE;
  EXEC sp_configure 'max worker threads';
  • A value of 0 means SQL Server is auto-calculating threads based on CPU count; a non-zero value indicates a manual override that may be too restrictive.

Step 2: Increase or Reset the Max Worker Threads Value

  • If the value is manually set too low, reset it to 0 to allow SQL Server to auto-manage based on available logical processors:
  EXEC sp_configure 'max worker threads', 0;
  RECONFIGURE WITH OVERRIDE;
  • Alternatively, manually increase the value (common range for high-core servers is 512–2048), but avoid setting it excessively high as it can cause memory pressure:
  EXEC sp_configure 'max worker threads', 1024;
  RECONFIGURE WITH OVERRIDE;
  • Restart the SQL Server service via SQL Server Configuration Manager or services.msc for the change to take effect.

Step 3: Review and Adjust Max Degree of Parallelism (MAXDOP)

  • Open SSMS → Server Properties → Advanced and check the “Max Degree of Parallelism” setting.
  • Lower the MAXDOP value (e.g., from 0 to 8 or a value matching NUMA node core count) to prevent single queries from consuming too many threads:
  EXEC sp_configure 'max degree of parallelism', 8;
  RECONFIGURE;
  • This reduces the likelihood of thread starvation during concurrent heavy analytical queries.

Step 4: Identify and Optimize Problematic Queries

  • Use the DMV below to find queries currently consuming excessive parallel workers:
  SELECT session_id, status, cpu_time, total_elapsed_time, text
  FROM sys.dm_exec_requests
  CROSS APPLY sys.dm_exec_sql_text(sql_handle)
  WHERE status = 'running';
  • Update outdated statistics or add missing indexes on tables referenced by long-running parallel queries using UPDATE STATISTICS or the Database Engine Tuning Advisor.

Step 5: Monitor Windows Server Resource Allocation

  • On Windows Server 2025/Windows 11, open Task Manager → Performance → CPU to confirm the OS is exposing all logical processors correctly to SQL Server (check for NUMA or affinity mask misconfigurations under SQL Server’s Processor Affinity settings in Server Properties).
  • Ensure no Group Policy or Windows power plan is throttling CPU cores, which can indirectly limit available worker threads.

Alternative or Verification Steps

  • After applying changes, run EXEC sp_configure 'max worker threads'; again and confirm the new value is active, then re-run the previously failing query/report to ensure Error 3627 no longer appears.
  • If the error persists, check SQL Server Error Log (via SSMS → Management → SQL Server Logs) for corroborating memory pressure or scheduler warnings, and consider isolating the workload using Resource Governor to cap parallelism per workload group.

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

Why This Error Happens

Error 3628 occurs when the SQL Server Database Engine encounters a floating-point arithmetic exception at the operating system level, typically triggered by a malformed query involving numeric/float conversions, corrupted query execution plans, or faulty arithmetic operations in extended stored procedures. This can also stem from underlying CPU-level floating-point unit (FPU) inconsistencies, outdated SQL Server builds with known calculation bugs, or corrupted database pages containing invalid numeric data. In rare cases, third-party CLR assemblies or linked server queries performing unsafe numeric casts can also trigger this exception.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query or Procedure

  • Check the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the exact timestamp and session ID (SPID) associated with Error 3628.
  • Correlate the SPID with Extended Events or Profiler trace data to isolate the specific T-SQL statement causing the crash.
  • Look specifically for CAST, CONVERT, or mathematical operations (/, %, POWER) involving FLOAT or REAL data types in the captured query text.

Step 2: Apply the Latest Cumulative Update (CU)

  • Navigate to the Microsoft Update Catalog and download the latest Cumulative Update for SQL Server 2025.
  • Run the installer with elevated privileges: Setup.exe /ACTION=Patch /INSTANCENAME=MSSQLSERVER /IACCEPTSQLSERVERLICENSETERMS.
  • Restart the SQL Server service via services.msc or by running NET STOP MSSQLSERVER && NET START MSSQLSERVER in an elevated Command Prompt.

Step 3: Check Database Integrity for Corruption

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to scan for corrupted pages that might contain invalid floating-point values.
  • If corruption is found, restore the affected table/database from the last known good backup rather than using REPAIR_ALLOW_DATA_LOSS, as this can permanently alter data.

Step 4: Rewrite the Query to Avoid Implicit Conversions

  • Modify the problematic query identified in Step 1 to explicitly cast variables using TRY_CONVERT instead of CONVERT to handle invalid numeric states gracefully.
  • Avoid dividing by variables that could resolve to zero or NULL without using a NULLIF() wrapper (e.g., SELECT ColumnA / NULLIF(ColumnB, 0)).

Alternative or Verification Steps

  • Verification: Re-run the specific query identified in Step 1 in a test environment (not production) to confirm the exception no longer triggers and the query returns a valid execution plan.
  • Alternative: If the error persists after patching, disable CLR Strict Security temporarily (sp_configure 'clr strict security', 0;) to rule out a faulty third-party assembly, then reconfigure and restart the instance.

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

Troubleshooting Guide: SQL Server Error 3625 – ‘%hs’ is not yet implemented

Why This Error Happens

Error 3625 occurs when SQL Server 2025 encounters a code path that invokes a feature, API, or backward-compatibility stub that has been deprecated, partially rolled out, or not yet enabled in the current build. This is commonly triggered by preview features, outdated Database Compatibility Levels, or third-party tools calling legacy extended stored procedures that Microsoft has flagged as placeholders in newer engine builds. It can also surface when a Cumulative Update (CU) or hotfix introduces new functionality that is referenced by metadata but whose execution logic has been intentionally stubbed out for a future release.

Step-by-Step Resolution Guide

Step 1: Identify the Exact Operation Triggering the Error

  • Check the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the full text replacing %hs.
  • Cross-reference the specific feature name (e.g., a specific DBCC command, system function, or Service Broker operation) against the SQL Server 2025 Release Notes.
  • Run SELECT @@VERSION; in SSMS to confirm your exact build number and CU level.

Step 2: Verify and Adjust Database Compatibility Level

  • Open SSMS and connect to the instance.
  • Run the following to check current compatibility mode:
  SELECT name, compatibility_level FROM sys.databases;
  • If the database is running at a compatibility level higher than what the engine fully supports (e.g., set to 170 on a build still finalizing certain 2025 features), roll it back one level:
  ALTER DATABASE [YourDB] SET COMPATIBILITY_LEVEL = 160;

Step 3: Apply the Latest Cumulative Update

  • Navigate to the Microsoft Update Catalog and download the latest CU for SQL Server 2025.
  • On Windows Server 2025 / Windows 11, run the installer as Administrator:
  Start-Process -FilePath "SQLServer2025-KB XXXXXXX-x64.exe" -ArgumentList "/quiet /IAcceptSQLServerLicenseTerms" -Wait
  • Reboot the server if prompted, then re-run the failing query or job.

Step 4: Disable or Bypass Preview/Experimental Features

  • Open sp_configure and check for any advanced options enabling preview functionality:
  EXEC sp_configure 'show advanced options', 1;
  RECONFIGURE;
  EXEC sp_configure;
  • If a “preview feature” flag (such as a new intelligent query processing option) is set to 1, disable it:
  EXEC sp_configure 'feature_name', 0;
  RECONFIGURE;

Step 5: Review Third-Party Tools and Linked Server Drivers

  • Confirm that backup tools, monitoring agents, or ETL connectors (SSIS, linked servers) are certified for SQL Server 2025.
  • Update OLE DB/ODBC drivers to the latest version matching the 2025 engine via the Microsoft Download Center.

Alternative or Verification Steps

  • To verify the fix, re-execute the exact query, job, or maintenance task that originally threw Error 3625 and confirm it completes without returning the message.
  • If the error persists after patching and compatibility adjustments, open a support case with Microsoft CSS and provide the ERRORLOG snippet along with SELECT @@VERSION; output, as this specific error code often indicates an engine-side placeholder requiring a targeted hotfix rather than a configuration fix.

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

Troubleshooting Guide: SQL Server Error 3624 — “A System Assertion Check Has Failed”

Why This Error Happens

Error 3624 indicates that an internal SQL Server assertion has failed, meaning the Database Engine detected an unexpected internal state while executing a code path and halted to prevent further damage. This is typically triggered by severe memory corruption, a corrupted database page, a bug in a specific build of SQL Server 2025, or incompatible/outdated hardware drivers (storage or network) causing data integrity issues. It can also surface after an abrupt system crash, faulty RAM, or when running unsupported trace flags that destabilize internal engine logic.

Step-by-Step Resolution Guide

Step 1: Capture and Review the Full Error Context

  • Open the SQL Server Error Log located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Look for the full assertion text, including the file name, line number, and stack dump reference (e.g., SQLDump0001.txt) generated in the LOG folder.
  • Note the exact SPID, database ID, and page ID (if listed) involved at the time of the crash.

Step 2: Run Database Consistency Checks

  • Open SQL Server Management Studio (SSMS) or a command prompt and run:
  • DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is found, review repair options carefully (avoid REPAIR_ALLOW_DATA_LOSS unless a verified backup exists).
  • Restore from the most recent clean backup if corruption is confirmed on critical system or user pages.

Step 3: Validate Hardware and OS-Level Stability

  • On Windows Server 2025 / Windows 11, open Event Viewer and check the System log for disk, memory, or controller-related warnings (Event IDs 7, 9, 11, 51).
  • Run chkdsk C: /f /r (adjust drive letter) and reboot to repair file system-level issues.
  • Run Windows Memory Diagnostic (mdsched.exe) to rule out faulty RAM.
  • Update storage controller and network adapter drivers via Windows Update or OEM support site.

Step 4: Apply the Latest SQL Server 2025 Cumulative Update

  • Download the latest Cumulative Update (CU) from the Microsoft Update Catalog for SQL Server 2025.
  • Install the CU during a scheduled maintenance window, as many assertion failures are resolved in engine patches.
  • After installation, restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.

Step 5: Disable Non-Standard Trace Flags

  • Check startup parameters in SQL Server Configuration Manager under SQL Server Services → Properties → Startup Parameters.
  • Remove any undocumented or community-sourced trace flags (e.g., -T flags not recommended by Microsoft support).
  • Restart the SQL Server service and monitor the error log for recurrence.

Alternative or Verification Steps

  • Re-run DBCC CHECKDB and monitor the ERRORLOG for 24–48 hours to confirm the assertion does not reoccur under normal workload.
  • If the issue persists after patching and hardware validation, collect the generated SQLDumpXXXX.txt and .mdmp files from the LOG directory and open a Microsoft Support (CSS) ticket, as this may indicate an unreported engine defect requiring a hotfix.

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

Why This Error Happens

Error 3623 occurs when SQL Server encounters an invalid floating point operation during query execution, typically caused by arithmetic operations producing values outside the valid range for FLOAT or REAL data types (such as division resulting in infinity or NaN). This can stem from corrupted intermediate calculation buffers, a mismatched CPU instruction set (SSE/AVX) after a hardware or hypervisor migration, or outdated floating-point unit (FPU) drivers on Windows Server 2025. In some cases, this is also triggered by malformed data pages where numeric values were corrupted during an improper shutdown or storage-level fault.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query or Stored Procedure

  • Check the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the exact timestamp and session ID tied to Error 3623.
  • Run the following to correlate the session with recent query activity:
SELECT * FROM sys.dm_exec_requests WHERE session_id = <SPID>;
  • Isolate whether the error originates from a specific CAST, CONVERT, SUM, or division operation involving FLOAT/REAL columns.

Step 2: Validate Data Integrity on Affected Tables

  • Run DBCC CHECKDB against the database to rule out page-level corruption as the source of invalid floating-point values:
DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is found in a table housing FLOAT/REAL columns, restore the affected table/filegroup from the last known good backup rather than attempting a repair that may cause data loss.

Step 3: Verify CPU Instruction Set and Update Drivers

  • On Windows Server 2025/Windows 11 hosts (especially VMs recently migrated between hosts), confirm the hypervisor exposes a consistent CPU feature set (SSE4.2/AVX2) to avoid FPU emulation mismatches.
  • Update the chipset and CPU microcode drivers via Windows Update > Optional Updates > Driver Updates, or manually through the OEM/hypervisor vendor (e.g., VMware Tools, Hyper-V Integration Services).
  • Restart the SQL Server service after driver updates:
Restart-Service -Name 'MSSQLSERVER' -Force

Step 4: Apply the Latest SQL Server 2025 Cumulative Update

  • Download and install the latest Cumulative Update (CU) for SQL Server 2025 from the Microsoft Update Catalog, as floating-point handling bugs in specific query optimizer paths are frequently patched.
  • Verify the current build number before and after patching:
SELECT @@VERSION;

Step 5: Rewrite Problematic Arithmetic Logic

  • Modify the query to use TRY_CONVERT or add explicit NULLIF guards around division operations to prevent invalid float results:
SELECT ColumnA / NULLIF(ColumnB, 0) FROM YourTable;
  • Replace FLOAT/REAL with DECIMAL/NUMERIC where precision-sensitive calculations are not reliant on floating-point behavior.

Alternative or Verification Steps

  • Re-run the original failing query or job after each step; confirm no Error 3623 appears in the SQL Server Error Log for at least one full execution cycle (e.g., 24 hours for scheduled jobs).
  • If the error persists after patching and driver updates, isolate the query in a test environment with SET ARITHABORT ON and SET ANSI_WARNINGS ON to force SQL Server to surface the exact row/column causing the invalid operation for targeted remediation.

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

Troubleshooting Guide: Error 3622 — Invalid Floating Point Operation in SQL Server 2025

Why This Error Happens

Error 3622 occurs when SQL Server’s query processor encounters an invalid floating-point operation—such as an overflow, underflow, or a computation producing NaN (Not a Number)—typically during arithmetic operations on float or real data types. This is frequently triggered by corrupted data pages, a damaged database following an improper shutdown, or queries that perform mathematical operations (like division, exponentiation, or aggregate functions) on values that exceed the valid range for the floating-point data type. In some cases, this error surfaces due to underlying storage corruption or hardware-level memory errors affecting the data at rest.

Step-by-Step Resolution Guide

Step 1: Run DBCC CHECKDB to Identify Corruption

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Execute the following command against the database reporting the error:
DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for allocation or consistency errors, particularly around pages containing float or real columns.
  • If corruption is confirmed, note the affected table and index IDs for targeted repair.

Step 2: Isolate the Offending Query or Column

  • Use SQL Server Profiler or Extended Events to capture the exact query triggering Error 3622.
  • Check the query execution plan for operations involving CAST, CONVERT, POWER, LOG, EXP, or division on float/real columns.
  • Temporarily rewrite the query using TRY_CAST or TRY_CONVERT to isolate whether the issue is data-driven rather than storage corruption:
SELECT TRY_CAST(YourColumn AS float) FROM YourTable;
  • Cross-reference flagged rows against expected value ranges for float (approximately ±1.79E+308) and real (±3.40E+38).

Step 3: Repair or Restore Affected Data

  • If DBCC CHECKDB flagged corruption, run a repair option matching the severity:
DBCC CHECKDB ('YourDatabaseName') WITH REPAIR_REBUILD;
  • If data loss is deemed acceptable only as a last resort, use REPAIR_ALLOW_DATA_LOSS in a single-user mode session.
  • If corruption is extensive, restore the database from the most recent verified-clean backup instead of running repair commands.
  • Validate the underlying storage subsystem using chkdsk on Windows Server 2025 and review the Windows Event Viewer for Disk or NTFS-related warnings.

Step 4: Update SQL Server 2025 Cumulative Updates

  • Navigate to the Microsoft Update Catalog and confirm the instance is on the latest Cumulative Update (CU) for SQL Server 2025.
  • Apply the update via SQL Server Installation Center or Windows Update, ensuring the service is stopped beforehand through SQL Server Configuration Manager.
  • Restart the SQL Server service and re-run the original query that triggered Error 3622.

Alternative or Verification Steps

  • After applying fixes, re-execute DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS; and confirm zero allocation or consistency errors are returned.
  • If the error persists only on specific queries, replace raw float/real arithmetic with the decimal or numeric data type, which does not produce invalid floating-point exceptions under the same overflow conditions.

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

Troubleshooting Guide: Error 3620 — Automatic Checkpointing Disabled Due to Log Space

Why This Error Happens

This error occurs when the transaction log for a database fills up completely, preventing SQL Server from writing the internal records needed to perform an automatic checkpoint. It is typically caused by a long-running or uncommitted transaction holding the log open, log file growth being capped by a restrictive MAXSIZE setting, or the disk volume hosting the .ldf file running out of physical space. Until the log is truncated or expanded, SQL Server 2025 suspends automatic checkpointing to protect database consistency, requiring manual intervention from the database owner.

Step-by-Step Resolution Guide

Step 1: Identify the Log Space Consumer

  • Run DBCC SQLPERF(LOGSPACE); to confirm the percentage of log space used for the affected database.
  • Query sys.databases using log_reuse_wait_desc to see why the log isn’t being reused (e.g., ACTIVE_TRANSACTION, LOG_BACKUP, REPLICATION).
  • Check for long-running open transactions with DBCC OPENTRAN('YourDatabaseName'); and note any session IDs (SPIDs) holding the log active.

Step 2: Free Up Log Space Immediately

  • If the database is in Full or Bulk-Logged recovery model and no backups are running, perform a transaction log backup: BACKUP LOG [YourDatabaseName] TO DISK = 'E:\SQLBackups\YourDatabaseName_log.trn';
  • If disk space is physically exhausted on the volume (commonly C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\), move or delete unrelated files, or add additional capacity via Windows Server 2025 Disk Management.
  • If an orphaned or long-running transaction is blocking log reuse, consider killing the offending SPID identified in Step 1 using KILL <SPID>; after confirming it is safe to terminate.

Step 3: Expand or Reconfigure the Log File

  • Open SQL Server Management Studio (SSMS), right-click the database, select Properties, then navigate to the Files page.
  • Increase the MAXSIZE setting on the log file (YourDatabaseName_log.ldf) or set it to “Unrestricted File Growth” if space allows.
  • Alternatively, run a T-SQL command to manually grow the file: ALTER DATABASE [YourDatabaseName] MODIFY FILE (NAME = YourDatabaseName_log, SIZE = 5120MB);
  • Ensure the growth increment (FILEGROWTH) is set to a fixed MB value rather than a percentage to avoid unpredictable expansion delays.

Step 4: Force a Manual Checkpoint

  • Once log space has been freed or expanded, run CHECKPOINT; against the affected database to clear the warning state.
  • Confirm that automatic checkpointing has resumed by checking the SQL Server Error Log for a follow-up message indicating normal checkpoint activity.
  • Re-run DBCC SQLPERF(LOGSPACE); to verify the log space percentage has dropped significantly.

Alternative or Verification Steps

  • Verify the fix by monitoring the SQL Server Error Log (via SSMS > Management > SQL Server Logs) for the absence of further Error 3620 entries over the next 24 hours.
  • If the issue recurs frequently, consider switching the database recovery model to Simple (if point-in-time recovery is not required) using ALTER DATABASE [YourDatabaseName] SET RECOVERY SIMPLE;, or implement a scheduled log backup job via SQL Server Agent to prevent future log growth issues.

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

Troubleshooting Guide: SQL Server Error 3621 — “The Statement Has Been Terminated”

Why This Error Happens

Error 3621 is a generic wrapper message raised by SQL Server 2025 indicating that a prior statement failed and the transaction batch was halted, but it does not identify the root cause on its own. The actual trigger is almost always a preceding error in the same batch—commonly a constraint violation (PRIMARY KEY, FOREIGN KEY, CHECK), a data type conversion failure, a corrupted index page, or insufficient permissions on an underlying object. Because this error rides alongside another error number in the same message stack, troubleshooting requires identifying the companion error rather than treating 3621 as the primary fault.

Step-by-Step Resolution Guide

Step 1: Capture the Full Error Stack

  • Re-run the query in SQL Server Management Studio (SSMS) 21 or Azure Data Studio with “Include Actual Execution Plan” and full messages enabled.
  • Check the Messages tab for the error number immediately preceding 3621 (e.g., Error 547 for constraint violations or Error 8114 for conversion errors).
  • Query the SQL Server error log for corroborating entries:
  EXEC sp_readerrorlog 0, 1, 'terminated';

Step 2: Identify and Fix the Underlying Constraint or Data Issue

  • If the companion error references a constraint (e.g., FK_Orders_Customers), locate the offending row:
  SELECT * FROM dbo.Orders WHERE CustomerID NOT IN (SELECT CustomerID FROM dbo.Customers);
  • Correct or remove the invalid data, or temporarily disable the constraint using ALTER TABLE ... NOCHECK CONSTRAINT only if business rules permit.
  • For data type/conversion errors, validate source column definitions against the target schema using sys.columns.

Step 3: Check for Permissions or Object-Level Blocking

  • Verify the executing login has sufficient rights on the target table:
  SELECT * FROM fn_my_permissions('dbo.Orders', 'OBJECT');
  • On Windows Server 2025, confirm the SQL Server service account has not lost access due to Group Managed Service Account (gMSA) credential rotation in Active Directory.
  • Grant missing permissions via GRANT INSERT, UPDATE ON dbo.Orders TO [DomainUser].

Step 4: Run Database Integrity Checks

  • Rule out physical corruption as the root cause, especially if the error recurs on SELECT statements against specific tables:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review output for allocation or consistency errors and repair using REPAIR_REBUILD if needed (avoid REPAIR_ALLOW_DATA_LOSS unless a backup exists).

Alternative or Verification Steps

  • Re-execute the original statement in isolation after remediation; confirm no companion error (547, 515, 8114, etc.) appears in the Messages pane and the statement completes with the expected row count.
  • If the error persists intermittently, enable Extended Events (sqlserver.error_reported) filtered on error_number = 3621 to capture the exact statement and session context during production load for deeper root-cause analysis.

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

Troubleshooting Guide: SQL Server Error 3619 – Checkpoint Record Could Not Be Written (Log Full)

Why This Error Happens

This error occurs when the transaction log for a database has filled completely, leaving no space for SQL Server to write a checkpoint record. This typically happens because the log file has hit its configured MAXSIZE limit, the disk volume hosting the .ldf file is out of physical space, or long-running/uncommitted transactions are preventing log truncation. In some cases, a corrupted or misconfigured database with the recovery model set to FULL without regular log backups can cause the log to grow unchecked until it exhausts available space.

Step-by-Step Resolution Guide

Step 1: Identify the Log Space Usage and Root Cause

  • Run the following query to check log space consumption: DBCC SQLPERF(LOGSPACE);
  • Check the log_reuse_wait_desc column for the affected database using: SELECT name, log_reuse_wait_desc FROM sys.databases;
  • Common blockers include ACTIVE_TRANSACTION, LOG_BACKUP, or REPLICATION.

Step 2: Back Up the Transaction Log (If Recovery Model is FULL)

  • Navigate to SQL Server Management Studio (SSMS) or use T-SQL.
  • Execute: BACKUP LOG [YourDatabaseName] TO DISK = 'E:\SQLBackups\YourDatabaseName_Log.trn';
  • This action truncates the inactive portion of the log and frees up internal space without shrinking the physical file.

Step 3: Allocate Additional Disk Space or Expand the Log File

  • Open SSMS > Right-click the database > Properties > Files.
  • Manually increase the size of the .ldf file or adjust Autogrowth settings (recommend fixed MB growth rather than percentage to avoid fragmentation).
  • Alternatively, run: ALTER DATABASE [YourDatabaseName] MODIFY FILE (NAME = YourDB_Log, SIZE = 5GB);
  • If the OS volume (e.g., E:\) is full, move the log file to a drive with more free space using ALTER DATABASE ... MODIFY FILE with a new FILENAME path, then offline/online the DB to complete the physical move.

Step 4: Kill Long-Running Transactions Blocking Log Truncation

  • Query active sessions holding open transactions: DBCC OPENTRAN('YourDatabaseName');
  • If a runaway session is identified via sp_who2 or sys.dm_exec_requests, safely terminate it using KILL [session_id]; only after confirming it is not a critical business transaction.

Step 5: Shrink the Log File (Post-Resolution Cleanup Only)

  • Once log backups are successful and space is freed, run: DBCC SHRINKFILE(YourDB_Log, 1024);
  • Note: Do not shrink the log file as a permanent fix; use this only to reclaim disk space after addressing the root cause, as frequent shrinking causes performance-impacting fragmentation.

Alternative or Verification Steps

  • Verification: Re-run DBCC SQLPERF(LOGSPACE); to confirm the “Log Space Used (%)” has dropped significantly and attempt a test transaction (e.g., an INSERT/UPDATE) to ensure the database accepts writes without triggering Error 3619 again.
  • Alternative Fix: If the recovery model is FULL but point-in-time recovery isn’t required, consider temporarily switching to SIMPLE recovery mode (ALTER DATABASE [YourDatabaseName] SET RECOVERY SIMPLE;) to force automatic log truncation at checkpoints, though this will break the log backup chain.

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

Troubleshooting Guide: SQL Server Error 3616 — Trigger Execution Failure

Why This Error Happens

Error 3616 occurs when a DML trigger (INSERT, UPDATE, or DELETE) encounters an unhandled exception during its execution, causing SQL Server to abort the entire batch and roll back the user transaction. This is typically caused by a logic error inside the trigger code itself—such as a constraint violation, data type mismatch, or a reference to a column/table that no longer exists—rather than a server configuration problem. In SQL Server 2025, this can also surface after schema changes (like a dropped column or renamed object) that were not reflected in the trigger definition, or due to corrupted/outdated compiled plans for the trigger object.

Step-by-Step Resolution Guide

Step 1: Identify the Failing Trigger and Root Cause

  • Check the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the detailed inner exception that accompanies Error 3616.
  • Run the following query to pinpoint the exact trigger object and the underlying error message:
  SELECT * FROM sys.messages WHERE message_id = 3616;
  SELECT OBJECT_NAME(object_id) AS TriggerName, * FROM sys.triggers;
  • Enable trace flag 3614 temporarily if you need extended diagnostic output for trigger-level transaction behavior.

Step 2: Review and Correct the Trigger Logic

  • Open SQL Server Management Studio (SSMS) 21 and script out the trigger definition using sp_helptext 'TriggerName'.
  • Look for common failure points: unresolved column references, foreign key violations, or divide-by-zero operations within the AFTER or INSTEAD OF block.
  • Wrap the trigger body in a TRY...CATCH block to gracefully handle exceptions instead of letting them abort the batch:
  BEGIN TRY
      -- trigger logic here
  END TRY
  BEGIN CATCH
      ROLLBACK TRANSACTION;
      THROW;
  END CATCH
  • Save and redeploy the corrected trigger using ALTER TRIGGER.

Step 3: Validate Schema Consistency

  • Run sp_refreshview or sp_recompile 'TableName' to force SQL Server to refresh cached execution plans tied to the trigger.
  • Confirm all referenced tables/columns in the trigger still exist using sys.columns and sys.objects queries.
  • Check that any linked server or cross-database references used in the trigger are still valid and accessible from Windows Server 2025.

Step 4: Test Transaction Isolation and Permissions

  • Verify the executing login has sufficient permissions (ALTER, EXECUTE) on the trigger and underlying tables via SELECT * FROM fn_my_permissions(NULL, 'OBJECT').
  • Ensure XACT_ABORT is set appropriately (SET XACT_ABORT ON) at the top of the trigger to control transaction rollback behavior consistently.

Alternative or Verification Steps

  • Re-run the original INSERT/UPDATE/DELETE statement that triggered the error and confirm it completes without raising Error 3616 in SSMS’s Messages tab.
  • If the error persists, disable the trigger temporarily (DISABLE TRIGGER TriggerName ON TableName) to confirm the trigger is indeed the source, then re-enable it once the corrected logic is deployed.

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

Why This Error Happens

Error 3615 is not a failure message but an informational output generated by SET STATISTICS IO ON, reporting the number of times a table was accessed (scan count) and logical/physical reads during query execution. This message typically surfaces unexpectedly when diagnostic session settings are left enabled, when a query plan performs excessive scans due to missing or outdated indexes, or when statistics are stale causing the optimizer to choose inefficient access paths. In SQL Server 2025 on Windows Server 2025/Windows 11, this is most often tied to poor indexing strategy, outdated statistics, or diagnostic flags inadvertently left active in a session or connection pool.

Step-by-Step Resolution Guide

Step 1: Verify Session-Level Diagnostic Settings

  • Open SQL Server Management Studio (SSMS) and check if SET STATISTICS IO ON was left active in the current session or a reused connection pool.
  • Run SET STATISTICS IO OFF; to suppress the message if it is only a diagnostic artifact and not an actual performance issue.
  • Check connection string settings in your application (e.g., App.config or appsettings.json) for any lingering diagnostic flags.

Step 2: Update Statistics and Rebuild Indexes

  • Navigate to SSMS → Object Explorer → Databases → [Your Database] → Tables → [Table Name] → Statistics.
  • Run UPDATE STATISTICS [TableName] WITH FULLSCAN; to refresh outdated statistics causing excessive scan counts.
  • Rebuild fragmented indexes using ALTER INDEX ALL ON [TableName] REBUILD; especially if fragmentation exceeds 30%.

Step 3: Analyze the Execution Plan for Scan Inefficiencies

  • In SSMS, enable “Include Actual Execution Plan” (Ctrl+M) and re-run the query to identify Table Scans or Index Scans contributing to the high scan count.
  • Add missing indexes suggested by the execution plan, or create a covering index using CREATE INDEX IX_TableName_Column ON [TableName] (Column) INCLUDE (OtherColumns);.
  • Check C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for recurring scan-related warnings tied to specific queries.

Step 4: Validate Server and OS-Level Resource Constraints

  • Open Windows Server 2025/Windows 11 Task Manager or Performance Monitor (perfmon.exe) and check for memory pressure affecting SQL Server’s buffer cache, which can force repeated table scans.
  • Confirm SQL Server Max Server Memory is correctly configured via SSMS → Server Properties → Memory, leaving adequate RAM for the OS (typically 10-20% reserved).
  • Restart the SQL Server service via services.msc or run net stop MSSQLSERVER && net start MSSQLSERVER if memory settings were adjusted.

Alternative or Verification Steps

  • Re-run the query with SET STATISTICS IO ON; intentionally and confirm scan counts have dropped to expected levels (ideally 1 per table for simple queries) after index/statistics updates.
  • If scan counts remain high, use Query Store (Database Properties → Query Store) to compare plan performance before and after changes, and force a better-performing plan if regression is detected.

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

Troubleshooting Guide: SQL Server Error 3613 — “SQL Server parse and compile time”

Why This Error Happens

This message is actually a diagnostic trace output rather than a true error, and it typically surfaces when SET STATISTICS TIME ON or an extended event session is capturing parse/compile metrics during query execution. It becomes a visible “issue” when excessive parse and compile CPU time indicates plan cache bloat, outdated statistics, or missing indexes causing the optimizer to work harder than expected. In some cases, corrupted procedure cache entries or a misconfigured max server memory setting on Windows Server 2025 can also inflate compile times unnecessarily.

Step-by-Step Resolution Guide

Step 1: Confirm the Source of the Message

  • Open SQL Server Management Studio (SSMS) and check if SET STATISTICS TIME ON is active in the session.
  • Review Extended Events sessions via SELECT * FROM sys.dm_xe_sessions; to see if a trace is logging compile time.
  • Check Windows Event Viewer under Applications and Services Logs > Microsoft > SQL Server for correlating Event ID 3613 entries.

Step 2: Clear and Rebuild the Procedure Cache

  • Run the following to flush the plan cache (use cautiously in production):
  DBCC FREEPROCCACHE;
  • Update statistics on the affected database to help the optimizer generate efficient plans faster:
  EXEC sp_updatestats;
  • Rebuild fragmented indexes using ALTER INDEX ALL ON [TableName] REBUILD;

Step 3: Adjust Memory and Configuration Settings

  • Open SQL Server Configuration Manager (search for it in Windows 11 Start Menu or run SQLServerManager16.msc).
  • Navigate to SQL Server Services, confirm the service account has sufficient privileges, and restart the SQL Server service.
  • In SSMS, verify max server memory (MB) is appropriately set under Server Properties > Memory (avoid starving the OS, especially on Windows Server 2025 with Hyper-V roles active).

Step 4: Disable Unnecessary Diagnostic Tracing

  • If the message appears only in debug/testing environments, disable SET STATISTICS TIME ON in your scripts.
  • Remove any active Extended Events sessions you no longer need:
  DROP EVENT SESSION [SessionName] ON SERVER;

Alternative or Verification Steps

  • Run a sample query with SET STATISTICS TIME ON; manually and confirm the parse/compile CPU time has dropped to near-zero (under 5ms) after cache rebuild.
  • If high compile times persist, use sys.dm_exec_query_stats to identify specific problem queries and consider forcing a plan via USE PLAN or creating a Plan Guide as a workaround.

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

Why This Error Happens

Error 3614 is not a true failure condition—it is an informational diagnostic message that SQL Server writes to the error log when internal verbose logging trace flags (such as 3004, 3213, or 3605) are enabled, typically for backup/restore or checkpoint performance tuning. The “Batch Statistics: Overall Duration” output is generated by the Storage Engine’s internal timing instrumentation, which gets triggered when these trace flags are active globally or at the session level. Because it is logged with a message ID, monitoring tools or log parsers often misclassify it as a critical error, when in reality it simply reports batch execution timing.

Step-by-Step Resolution Guide

Step 1: Identify Active Trace Flags

  • Connect to the instance via SSMS or sqlcmd and run DBCC TRACESTATUS(-1); to list all currently enabled trace flags.
  • Look specifically for 3004, 3213, 3605, or 1204/1222 (locking diagnostics), as these commonly trigger verbose batch statistics logging.
  • Check the SQL Server startup parameters in SQL Server Configuration Manager > SQL Server Services > Properties > Startup Parameters for any -T flags that persist across restarts.

Step 2: Disable Unnecessary Verbose Logging

  • If the trace flags were enabled for a one-time diagnostic session, turn them off immediately using DBCC TRACEOFF (3004, 3213, -1);
  • If they were set at the service level via startup parameters, remove the corresponding -T3004 or -T3213 entries in Configuration Manager.
  • Restart the SQL Server service for the startup parameter changes to take effect: Restart-Service -Name 'MSSQLSERVER' (PowerShell, run as Administrator on Windows Server 2025).

Step 3: Adjust Error Log Verbosity and Filtering

  • Open SQL Server Management Studio > Management > SQL Server Logs and confirm whether the batch statistics messages continue after trace flags are disabled.
  • If you need to retain some diagnostic flags for ongoing backup compression tuning, redirect this noise by filtering Event Viewer/Log Viewer queries to exclude Message ID 3614 using the SSMS log filter dialog (Log Entry contains field, set to exclude “Batch Statistics”).
  • Ensure the SQL Server Error Log path (default: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) isn’t growing excessively due to this verbose output; cycle the log via EXEC sp_cycle_errorlog; if needed.

Step 4: Validate Application and Job Dependencies

  • Check SQL Server Agent jobs, maintenance plans, or third-party backup tools (e.g., for full/differential backups) that may explicitly enable these trace flags via WITH TRACEFLAG hints in backup scripts.
  • Remove or comment out any DBCC TRACEON calls embedded in T-SQL job steps that are no longer required for troubleshooting.

Alternative or Verification Steps

  • Re-run DBCC TRACESTATUS(-1); after remediation to confirm no unwanted trace flags remain active, and monitor the ERRORLOG for a few hours to verify Error 3614 no longer appears.
  • If verbose statistics are still required for ongoing performance analysis, redirect output to Extended Events sessions instead of the main error log, using CREATE EVENT SESSION with a ring_buffer or file target to isolate diagnostic noise from production logs.

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

Troubleshooting Guide: SQL Server Error 3612 — “SQL Server Execution Times” / CPU Time Reporting Anomaly

Why This Error Happens

Error 3612 typically surfaces when SQL Server’s statistics output mechanism (SET STATISTICS TIME ON) encounters an interruption while reporting execution time metrics, often due to a corrupted plan cache or an inconsistent session state. This can also occur when Windows Server 2025’s updated performance counter architecture conflicts with SQL Server 2025’s telemetry hooks, causing malformed CPU time strings to be returned mid-query. In some cases, insufficient permissions on the Performance Monitor Users group prevent SQL Server from correctly reading CPU tick counters from the OS, triggering this error as a fallback message.

Step-by-Step Resolution Guide

Step 1: Verify SQL Server Service Account Permissions

  • Open Computer Management > Local Users and Groups > Groups.
  • Confirm the SQL Server service account is a member of Performance Monitor Users and Performance Log Users.
  • Run net localgroup "Performance Monitor Users" in an elevated PowerShell/Command Prompt to verify membership.
  • If missing, add it with: net localgroup "Performance Monitor Users" "DOMAIN\SQLServiceAccount" /add

Step 2: Clear and Rebuild the Plan Cache

  • Connect via SQL Server Management Studio (SSMS) 21 (compatible with SQL Server 2025).
  • Run DBCC FREEPROCCACHE; to clear potentially corrupted cached execution plans.
  • Follow with DBCC FREESYSTEMCACHE('ALL'); to ensure system-level caches are also reset.
  • Restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.

Step 3: Update SQL Server 2025 Cumulative Update (CU)

  • Navigate to Microsoft Update Catalog and search for the latest Cumulative Update for SQL Server 2025.
  • Download and install the CU package (typically an .exe installer run with administrative rights).
  • Confirm the build number post-install by running SELECT @@VERSION; in SSMS.

Step 4: Reset SQL Server Statistics Session Settings

  • In your query window, explicitly reset session-level statistics flags before execution:
  • SET STATISTICS TIME OFF;
  • SET STATISTICS TIME ON;
  • If the error persists in SSMS, close and reopen the query window to clear any corrupted session buffer.

Step 5: Check Windows Performance Counter Registry Health

  • Open an elevated Command Prompt and run: lodctr /R to rebuild performance counter registry values.
  • Restart the Windows Management Instrumentation (WMI) service via services.msc.
  • Restart the SQL Server instance to re-initialize counter bindings.

Alternative or Verification Steps

  • Run a simple test query with SET STATISTICS TIME ON; followed by SELECT 1; — if CPU time displays cleanly without Error 3612, the fix was successful.
  • If the issue persists, use SQL Server Profiler or Extended Events to capture the exact query/session triggering the error, and cross-reference with the SQL Server Error Log (ERRORLOG file, typically in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\) for additional context.

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

Troubleshooting Guide: SQL Server Error 3611 – “CPU Time Not Measured Under Fiber Mode”

Why This Error Happens

This message appears when SQL Server 2025 is configured to run in lightweight pooling mode (fiber mode) instead of the default thread mode. Because fibers operate on a shared thread rather than individual OS threads, the Windows scheduler cannot accurately attribute CPU time to individual SQL Server tasks, causing the engine to log this informational message during query execution statistics collection (SET STATISTICS TIME ON). This is not inherently a corruption or permissions issue—it is a direct side effect of the lightweight pooling configuration option being enabled, usually set to optimize for high-CPU, high-context-switch environments.

Step-by-Step Resolution Guide

Step 1: Confirm Fiber Mode is Enabled

  • Open SQL Server Management Studio (SSMS) and connect to the target instance.
  • Run the following query to check the current configuration:
EXEC sp_configure 'lightweight pooling';
  • If the run_value column returns 1, fiber mode is active and is the root cause of the message.

Step 2: Disable Lightweight Pooling (Recommended Fix)

  • Run the following T-SQL commands to turn off fiber mode:
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure 'lightweight pooling', 0;
RECONFIGURE;
  • This reverts SQL Server to standard thread-based scheduling, which restores full CPU time accounting accuracy.

Step 3: Restart the SQL Server Service

  • On Windows Server 2025 / Windows 11, open Services.msc.
  • Locate SQL Server (MSSQLSERVER) or your named instance (e.g., SQL Server (INSTANCENAME)).
  • Right-click and select Restart to apply the configuration change (lightweight pooling requires a service restart to take effect).
  • Alternatively, restart via PowerShell:
Restart-Service -Name 'MSSQLSERVER' -Force

Step 4: Suppress the Message if Fiber Mode Must Remain Active

  • If your workload specifically requires fiber mode (e.g., legacy COM+ or specific high-concurrency scenarios), you cannot eliminate the message without disabling fiber mode.
  • Instead, filter it out at the client/application level by ignoring Informational Severity 10 messages in your connection’s message handler, since Error 3611 is non-fatal and does not affect query results.

Step 5: Review SQL Server Error Log for Related Configuration Drift

  • Navigate to the default log path: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Search for “lightweight pooling” entries to confirm when and how the setting was last changed, which helps identify if a deployment script or DBA process is re-enabling it unintentionally.

Alternative or Verification Steps

  • Verify the Fix: Re-run EXEC sp_configure 'lightweight pooling'; and confirm both config_value and run_value are set to 0. Then execute a test query with SET STATISTICS TIME ON; to confirm CPU time is now reported correctly instead of showing the “not measured” message.
  • Alternative: If disabling fiber mode is not feasible due to third-party application dependencies, suppress the specific message using Extended Events filtering on error_reported with error_number = 3611 to keep logs clean without altering server behavior.

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

Troubleshooting Guide: SQL Server Error 3609 — “The Transaction Ended in the Trigger. The Batch Has Been Aborted.”

Why This Error Happens

This error occurs when a trigger explicitly issues a ROLLBACK TRANSACTION or COMMIT statement that conflicts with the outer transaction state initiated by the calling batch, causing SQL Server to terminate the entire batch for safety. It is commonly caused by poorly designed trigger logic that does not account for nested transactions, or by a SET XACT_ABORT configuration mismatch between the session and the trigger. In some cases, this also surfaces due to constraint violations or explicit error-handling code inside the trigger that forces a rollback mid-execution.

Step-by-Step Resolution Guide

Step 1: Review the Trigger Definition

  • Open SQL Server Management Studio (SSMS) and navigate to the affected table under Databases > [YourDB] > Tables > [TableName] > Triggers.
  • Script out the trigger using Right-click > Script Trigger as > ALTER To.
  • Look specifically for any ROLLBACK TRANSACTION or COMMIT TRANSACTION statements inside the trigger body, as these are the primary cause of premature batch termination.

Step 2: Enable XACT_ABORT for Consistent Transaction Handling

  • At the top of the trigger script, add or verify the presence of SET XACT_ABORT ON; before any transactional logic.
  • This ensures that if a runtime error occurs, the entire transaction is rolled back cleanly rather than leaving it in an ambiguous state that triggers Error 3609.
  • Example syntax to insert at the top of the trigger:
  ALTER TRIGGER [dbo].[YourTriggerName]
  ON [dbo].[YourTable]
  AFTER INSERT, UPDATE
  AS
  SET XACT_ABORT ON;
  BEGIN
      -- trigger logic here
  END;

Step 3: Replace Explicit ROLLBACK with TRY/CATCH Error Handling

  • Refactor the trigger to use a BEGIN TRY ... END TRY BEGIN CATCH ... END CATCH block instead of a bare ROLLBACK TRANSACTION call.
  • Inside the CATCH block, check XACT_STATE() to determine if the transaction is committable, uncommittable, or has no active transaction before attempting a rollback.
  • This prevents the trigger from forcibly terminating a transaction that the outer batch (or application) still expects to control.

Step 4: Validate Application-Level Transaction Scope

  • Check the calling application (e.g., .NET, SSIS package, or stored procedure) for nested BEGIN TRANSACTION calls that may conflict with the trigger’s internal logic.
  • Ensure the application correctly checks @@TRANCOUNT or @@ERROR after each batch execution to detect early termination.

Alternative or Verification Steps

  • To verify the fix, run the original batch/query that previously failed and confirm it completes without raising Error 3609 in the Messages tab of SSMS; also check the SQL Server Error Log (Management > SQL Server Logs) for any residual trigger-related warnings.
  • If the error persists, as a temporary workaround, disable the trigger using DISABLE TRIGGER [TriggerName] ON [TableName]; to confirm the trigger is indeed the root cause, then re-enable it only after the logic has been corrected and tested in a non-production environment.

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

Troubleshooting Guide: SQL Server Error 3608 – “Cannot Allocate a GUID for the Token”

Why This Error Happens

Error 3608 typically occurs when SQL Server 2025 is unable to generate or reserve a unique GUID token due to internal resource contention, often triggered by a corrupted tempdb database or exhausted metadata structures. This can also happen when a database is started in single-user or emergency repair mode, restricting the system’s ability to allocate internal tracking tokens. In some cases, insufficient permissions on system-level objects prevent SQL Server from completing the GUID allocation process during session initialization.

Step-by-Step Resolution Guide

Step 1: Verify tempdb Health and Configuration

  • Open SQL Server Management Studio (SSMS) and connect via a Dedicated Administrator Connection (DAC) by prefixing the server name with ADMIN:.
  • Run DBCC CHECKDB (tempdb) to check for corruption.
  • Confirm tempdb data/log files exist at the expected path (default: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\).
  • Restart the SQL Server service if tempdb files appear locked or inaccessible via services.msc.

Step 2: Check Database Mode and Permissions

  • Ensure the affected database is not stuck in single-user mode by running:
    ALTER DATABASE [YourDB] SET MULTI_USER;
  • Verify the login executing the query has db_owner or sufficient CONTROL permissions on the database.
  • Check Windows Event Viewer under Applications and Services Logs > Microsoft > Windows > SQL Server for related permission-denial entries.

Step 3: Rebuild or Reset System Metadata

  • Run DBCC CHECKDB against the user database reporting the error to rule out system table corruption.
  • If corruption is confirmed, restore from a known good backup rather than using REPAIR_ALLOW_DATA_LOSS, which may worsen token corruption.
  • Restart the SQL Server (MSSQLSERVER) service via PowerShell:
    Restart-Service -Name 'MSSQLSERVER' -Force

Step 4: Apply Latest SQL Server 2025 Cumulative Update

  • Open SQL Server Configuration Manager and confirm the current build number via SELECT @@VERSION;.
  • Download and install the latest Cumulative Update (CU) from the Microsoft Update Catalog, as GUID allocation bugs are frequently patched in CUs.
  • Reboot Windows Server 2025 / Windows 11 after installation to finalize the update.

Alternative or Verification Steps

  • Re-run the original query or transaction that triggered Error 3608; if it completes without error, the fix is confirmed.
  • If the issue persists, create a brand-new tempdb by stopping SQL Server, deleting the tempdb files, and allowing SQL Server to regenerate them on next startup (only if default tempdb path is used).

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

Troubleshooting Guide: SQL Server Error 3606 – Arithmetic Overflow

Why This Error Happens

Error 3606 occurs when an arithmetic operation (such as multiplication, division, or implicit conversion) produces a value that exceeds the storage capacity of the target data type, such as TINYINT, SMALLINT, INT, or DECIMAL. This commonly happens with implicit data type conversions in calculations, undersized DECIMAL/NUMERIC precision and scale definitions, or when aggregate functions like SUM() operate on columns whose combined result exceeds the column’s native type limit. It can also surface after migrating databases to SQL Server 2025 if legacy stored procedures rely on older, looser overflow-handling behavior that newer compatibility levels no longer tolerate.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query or Procedure

  • Check the SQL Server error log or Extended Events session for the exact statement that triggered Error 3606.
  • Run the query manually in SQL Server Management Studio (SSMS) to reproduce the error and capture the execution plan.
  • Use SET ARITHABORT ON; before running the query to force immediate termination and pinpoint the failing expression.

Step 2: Review and Adjust Data Types

  • Inspect the schema using sp_help 'YourTableName'; to check column data types involved in the calculation.
  • Increase precision/scale on DECIMAL/NUMERIC columns, e.g., change DECIMAL(5,2) to DECIMAL(10,2) if values can exceed 999.99.
  • Explicitly cast intermediate calculation results to a larger type using CAST(column AS BIGINT) or CAST(column AS DECIMAL(18,4)) instead of relying on implicit conversions.

Step 3: Check Database Compatibility Level

  • Open SSMS, right-click the database, go to Properties > Options, and verify the Compatibility Level field.
  • If recently migrated, compare behavior against the previous SQL Server version’s compatibility level (e.g., 150 for SQL Server 2019 vs. 170 for SQL Server 2025).
  • Run ALTER DATABASE YourDB SET COMPATIBILITY_LEVEL = 170; only after testing, since compatibility level changes can affect other query behaviors.

Step 4: Patch and Update SQL Server

  • Confirm you are running the latest Cumulative Update (CU) for SQL Server 2025 via SELECT @@VERSION;.
  • Download and apply the latest CU from the Microsoft Update Catalog if your build number is outdated, as some overflow-handling bugs are patched in service releases.
  • Restart the SQL Server service (services.msc on Windows Server 2025/Windows 11) after installing updates.

Step 5: Modify Application-Level Calculations

  • If the overflow originates from application code (e.g., .NET, Power BI, or SSIS packages) rather than raw T-SQL, review variable declarations passed into stored procedure parameters.
  • Ensure parameter types in connection strings or ORM mappings (Entity Framework, ADO.NET) match the SQL Server column definitions exactly.

Alternative or Verification Steps

  • Re-run the original query or application workflow that previously failed; confirm no Error 3606 appears in SSMS or the Windows Event Viewer (Applications and Services Logs > MSSQLSERVER).
  • As an alternative, wrap the calculation in a TRY_CAST() or TRY_CONVERT() function to gracefully return NULL instead of throwing a hard error, allowing you to isolate problematic rows with a follow-up WHERE result IS NULL query.

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

Troubleshooting Guide: Error 3607 – Division by Zero

Why This Error Happens

Error 3607 occurs when SQL Server encounters an arithmetic operation that attempts to divide a value by zero during query execution, typically within a calculated column, aggregate function, or stored procedure logic. This is most often caused by unvalidated user input, NULL-to-zero coercion in computed columns, or missing guard clauses in T-SQL code that fails to check denominator values before performing division. In some cases, it can also surface after a database migration or upgrade to SQL Server 2025 if legacy code relied on the deprecated ARITHIGNORE session behavior instead of proper SET ARITHABORT handling.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query or Object

  • Check the SQL Server Error Log or Extended Events session for the exact batch, procedure, or statement that raised Error 3607.
  • Run the following to capture live occurrences:
  SELECT * FROM sys.dm_exec_query_stats 
  WHERE last_execution_time > DATEADD(HOUR, -1, GETDATE());
  • Review application logs (Event Viewer > Applications and Services Logs > MSSQLSERVER) for correlating timestamps.

Step 2: Patch the T-SQL Code with NULLIF or CASE Logic

  • Replace unsafe division operations with a NULLIF wrapper to prevent zero denominators:
  SELECT SalesAmount / NULLIF(UnitsSold, 0) AS AvgUnitPrice
  FROM Sales.OrderDetails;
  • Alternatively, use a CASE statement for more complex business logic:
  SELECT CASE WHEN UnitsSold = 0 THEN NULL ELSE SalesAmount / UnitsSold END
  FROM Sales.OrderDetails;

Step 3: Adjust Session-Level ARITHABORT Settings

  • Ensure SET ARITHABORT ON is enabled for the session or database to maintain consistent error-handling behavior:
  ALTER DATABASE [YourDatabaseName] SET ARITHABORT ON;
  • Verify this setting aligns with your application’s connection string options (especially for ODBC/OLEDB drivers on Windows Server 2025).

Step 4: Rebuild or Validate Computed Columns

  • If the error originates from a persisted computed column, drop and recreate it with safe division logic.
  • Use SQL Server Management Studio (SSMS) 2025 to inspect the column definition:
  EXEC sp_helptext 'dbo.YourTableName';
  • Rebuild the column using the NULLIF pattern from Step 2.

Alternative or Verification Steps

  • Re-run the original query or stored procedure after applying the fix; confirm no Error 3607 appears in SSMS or the Windows Event Viewer.
  • If the issue persists in a third-party application, enable SET ARITHIGNORE ON as a temporary workaround (not recommended long-term) while the underlying query is refactored by the application vendor or internal development team.

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

Troubleshooting Guide: Error 3605 – Schema Verification Failed

Why This Error Happens

Error 3605 occurs when SQL Server’s internal metadata catalog does not match the actual physical schema of database objects, often triggered during DBCC operations, replication, or database upgrades. This mismatch typically stems from corrupted system catalog pages, an interrupted schema change operation (such as an ALTER TABLE that didn’t commit cleanly), or inconsistencies introduced during a version upgrade to SQL Server 2025. In some cases, insufficient permissions on the sys schema metadata views can also prevent the verification process from completing correctly.

Step-by-Step Resolution Guide

Step 1: Run Database Consistency Checks

  • Open SQL Server Management Studio (SSMS) or sqlcmd connected to the affected instance.
  • Execute DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to identify corruption.
  • Review the output for allocation or catalog errors referencing the specific object causing the mismatch.

Step 2: Validate System Catalog Integrity

  • Run DBCC CHECKCATALOG ('YourDatabaseName'); to specifically isolate metadata inconsistencies.
  • Cross-reference flagged object IDs using SELECT * FROM sys.objects WHERE object_id = <ID>;.
  • If orphaned metadata entries are found, document the object names before attempting repair.

Step 3: Repair or Rebuild the Affected Schema

  • If corruption is confirmed, take the database into single-user mode: ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • Run DBCC CHECKDB ('YourDatabaseName', REPAIR_REBUILD); — avoid REPAIR_ALLOW_DATA_LOSS unless a verified backup exists.
  • Switch back to multi-user mode: ALTER DATABASE YourDatabaseName SET MULTI_USER;

Step 4: Restore From a Verified Backup (If Repair Fails)

  • Navigate to your backup directory (typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\ on Windows Server 2025).
  • Restore the last known-good .bak file using RESTORE DATABASE YourDatabaseName FROM DISK = 'PathToBackup.bak' WITH REPLACE;.
  • Reapply any transaction logs created after the backup to minimize data loss.

Step 5: Verify Permissions on Metadata Views

  • Confirm the service account running SQL Server 2025 has VIEW SERVER STATE and VIEW DATABASE STATE permissions.
  • Check via SELECT * FROM sys.fn_my_permissions(NULL, 'SERVER'); to ensure no permission gaps are blocking schema validation.

Alternative or Verification Steps

  • Re-run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS; after remediation — a clean pass with zero errors confirms the fix.
  • If the error persists after repair and restore attempts, open a Microsoft Support case and provide the SQL Server error log located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for deeper diagnostic analysis.

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

Troubleshooting Guide: SQL Server Error 3604 – “Duplicate Key Was Ignored”

Why This Error Happens

This error occurs when SQL Server attempts to rebuild or create a unique index and encounters rows with duplicate values in the column(s) being indexed. It commonly surfaces during DBCC operations, index maintenance tasks, or when restoring a database with a corrupted unique index definition. The root cause is typically a data integrity violation that existed before the unique constraint was enforced, or index metadata corruption following an improper shutdown.

Step-by-Step Resolution Guide

Step 1: Identify the Affected Index and Table

  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to capture the full error context.
  • Note the Object ID and Index ID referenced alongside Error 3604 in the output.
  • Cross-reference the Object ID using SELECT OBJECT_NAME(object_id) FROM sys.indexes WHERE index_id = <ID>;

Step 2: Locate and Remove Duplicate Rows

  • Query the table using a GROUP BY on the indexed column(s) with HAVING COUNT(*) > 1 to surface duplicates.
  • Use a Common Table Expression (CTE) with ROW_NUMBER() to isolate and delete redundant rows while retaining the original record.
  • Example:
  WITH CTE AS (
    SELECT *, ROW_NUMBER() OVER (PARTITION BY DuplicateColumn ORDER BY ID) AS rn
    FROM YourTable
  )
  DELETE FROM CTE WHERE rn > 1;

Step 3: Rebuild the Unique Index

  • Execute ALTER INDEX [IndexName] ON [YourTable] REBUILD; to restore the index structure.
  • If the index is severely corrupted, drop and recreate it manually using CREATE UNIQUE INDEX.
  • Ensure the rebuild path has sufficient disk space on the drive hosting C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\.

Step 4: Validate Server and File Permissions

  • Confirm the SQL Server service account has Modify permissions on the data/log file directory via Windows Server 2025 File Explorer (Properties > Security tab).
  • Restart the SQL Server service using services.msc or net stop MSSQLSERVER && net start MSSQLSERVER to clear any locked file handles.

Alternative or Verification Steps

  • Re-run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS; after the rebuild to confirm Error 3604 no longer appears in the output.
  • If duplicates persist due to application-level logic, consider implementing an IGNORE_DUP_KEY = ON option on the index as a temporary workaround while the application insert logic is fixed.

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

Troubleshooting Guide: SQL Server Error 3470

Why This Error Happens

Error 3470 occurs during the crash recovery (redo) phase when SQL Server attempts to replay a file-size change (growth or shrink) logged in the transaction log, but the underlying file handle or connection to the database file is no longer valid. This typically happens because of a severed connection to the storage subsystem (common with SMB shares, Azure Files, or SAN/NAS mounts), an underlying disk I/O failure, or because the file was moved, renamed, or deleted while SQL Server was offline or mid-transaction. It can also surface after an improper shutdown where VSS snapshots or storage-level replication left the physical file in an inconsistent state relative to the log.

Step-by-Step Resolution Guide

Step 1: Verify Storage Connectivity and File Paths

  • Confirm the physical data/log files (.mdf, .ndf, .ldf) still exist at the exact path referenced in sys.master_files.
  • Run the following query against a connected instance (or another healthy instance) to check last known paths:
SELECT name, physical_name, state_desc FROM sys.master_files WHERE database_id = DB_ID('YourDatabaseName');
  • If using network-attached storage (SMB 3.0, Azure Files), verify the share is mounted and reachable:
Test-Path "\\StorageServer\SQLData\YourDB.mdf"
  • Check Windows Server 2025 Event Viewer under Windows Logs > System for Disk or SMBClient errors (Event ID 140, 50, or 153) around the time of the crash.

Step 2: Restart SQL Server Service and Force Recovery Retry

  • Stop the SQL Server service cleanly via SQL Server Configuration Manager.
  • Ensure the SQL Server service account has not lost its network credential cache (common after domain password rotations):
Restart-Service -Name 'MSSQLSERVER' -Force
  • Restart the instance and monitor the SQL Server Error Log (%ProgramFiles%\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for recovery progress messages.
  • If the database remains in RECOVERY_PENDING state, proceed to Step 3.

Step 3: Bring the Database Offline and Reattach

  • Take the affected database offline to release any stale file locks:
ALTER DATABASE YourDatabaseName SET OFFLINE WITH ROLLBACK IMMEDIATE;
  • Manually verify file size and permissions using icacls to ensure the SQL Server service account has Modify rights:
icacls "D:\SQLData\YourDB.mdf"
  • Bring the database back online:
ALTER DATABASE YourDatabaseName SET ONLINE;

Step 4: Restore From Backup if Recovery Fails

  • If the file remains inaccessible or corrupted beyond redo, restore the last known good full backup plus transaction log backups (if available) using WITH NORECOVERY then WITH RECOVERY:
RESTORE DATABASE YourDatabaseName FROM DISK = 'D:\Backups\YourDB_Full.bak' WITH NORECOVERY;
RESTORE LOG YourDatabaseName FROM DISK = 'D:\Backups\YourDB_Log.trn' WITH RECOVERY;
  • Confirm no pending VSS snapshot or storage replication job was interrupting the file at the time of failure.

Alternative or Verification Steps

  • After recovery, run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to confirm there is no residual corruption and the database is fully consistent.
  • If the issue persists specifically on network storage, consider migrating data/log files to local SSD/NVMe storage or validated Storage Spaces Direct volumes, as persistent connection drops to remote storage are the most common root cause of Error 3470 in Windows Server 2025 environments.

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

Troubleshooting Guide: Error 3505 – CHECKPOINT Permission Denied in SQL Server 2025

Why This Error Happens

Error 3505 occurs because the CHECKPOINT statement, when issued with parameters or in certain contexts, requires the executing login to be the database owner (db_owner) or hold sysadmin/CONTROL permissions on the database. By default, standard users and even some db_datawriter or db_datareader role members do not have sufficient rights to force a manual checkpoint. This typically surfaces when an application service account or a junior DBA attempts to run CHECKPOINT manually via a script, maintenance plan, or automated job without the proper role membership.

Step-by-Step Resolution Guide

Step 1: Identify the Executing Login and Database Context

  • Open SQL Server Management Studio (SSMS) and connect using an account with sysadmin privileges.
  • Run the following query to identify the current login attempting the command:
  SELECT SUSER_NAME(), CURRENT_USER;
  • Confirm the target database name referenced in the error message (%.*ls placeholder) to ensure you are modifying permissions on the correct database.

Step 2: Verify Current Role Membership

  • Execute the following command to check if the user belongs to the db_owner role:
  USE [YourDatabaseName];
  EXEC sp_helprolemember 'db_owner';
  • If the login is missing from this list, proceed to grant the necessary permissions in Step 3.

Step 3: Grant Appropriate Permissions

  • To add the user to the db_owner role (recommended for full administrative control), run:
  USE [YourDatabaseName];
  ALTER ROLE db_owner ADD MEMBER [DOMAIN\Username];
  • Alternatively, if you want to avoid full db_owner rights, grant the specific CONTROL permission on the database:
  GRANT CONTROL ON DATABASE::[YourDatabaseName] TO [DOMAIN\Username];
  • Save the changes and ensure no syntax errors were returned in the Messages pane.

Step 4: Restart the Session or Service

  • Ask the user to close and reopen their SSMS connection to refresh their permission token cache.
  • If the CHECKPOINT command is being run via an automated SQL Server Agent Job, restart the SQL Server Agent service via services.msc on the Windows Server 2025 host to clear any cached job owner credentials.

Alternative or Verification Steps

  • Verification: Have the user re-run the CHECKPOINT; command in a query window connected to the specific database; a successful execution will return “Command(s) completed successfully” with no red error text.
  • Alternative: If modifying roles is not permitted by your security policy, rewrite the maintenance script to run under a SQL Server Agent proxy account that already possesses sysadmin rights, bypassing the need to alter the end-user’s permissions.

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

Troubleshooting Guide: SQL Server Error 3469 – Restore Pipeline Queue Items Not Found

Why This Error Happens

Error 3469 occurs when SQL Server’s backup/restore engine loses synchronization between the producer and consumer threads responsible for moving data through the restore pipeline buffers. This typically results from corrupted backup media, an interrupted I/O stream caused by antivirus or storage driver interference, or insufficient memory buffers allocated to the restore operation (MAXTRANSFERSIZE/BUFFERCOUNT mismatch). In clustered or VSS-based backup scenarios on Windows Server 2025, a timing conflict between the snapshot writer and SQL Server’s internal pipeline threads can also trigger this error.

Step-by-Step Resolution Guide

Step 1: Validate Backup Media Integrity

  • Run RESTORE VERIFYONLY FROM DISK = 'D:\Backups\YourFile.bak' to confirm the backup file isn’t corrupted.
  • Check Windows Event Viewer (Application and System logs) for disk or storage controller errors around the backup timestamp.
  • If using network storage, confirm the share (e.g., \\BackupServer\SQLBackups\) is stable and not experiencing latency spikes.

Step 2: Adjust Restore Buffer Configuration

  • Re-run the restore with explicit buffer settings to prevent pipeline thread starvation:
    RESTORE DATABASE [YourDB] FROM DISK = 'D:\Backups\YourFile.bak' WITH BUFFERCOUNT = 50, MAXTRANSFERSIZE = 1048576, STATS = 10;
  • Lower BUFFERCOUNT if the SQL Server service account has limited memory (Min/Max Server Memory under Server Properties > Memory).
  • Restart the SQL Server service (services.msc > SQL Server (MSSQLSERVER)) after adjusting memory settings.

Step 3: Disable Interfering Services During Restore

  • Temporarily disable real-time antivirus scanning on the backup directory and SQL data/log folders (e.g., C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\).
  • If running on a Windows Server 2025 failover cluster, pause VSS-based backup agents (vssadmin list writers) to rule out writer conflicts.
  • Retry the restore operation in SQL Server Management Studio (SSMS) or via sqlcmd.

Step 4: Check for SQL Server Cumulative Updates

  • Confirm you’re on the latest Cumulative Update (CU) for SQL Server 2025 via SELECT @@VERSION;.
  • Download and apply the latest CU from the Microsoft Update Catalog if the build is outdated, as pipeline threading issues are frequently patched.
  • Reboot the server and re-attempt the restore after patching.

Alternative or Verification Steps

  • Verify the fix by running the restore again and confirming the database reaches an “ONLINE” state: SELECT name, state_desc FROM sys.databases WHERE name = 'YourDB';
  • If the error persists, attempt the restore using WITH CONTINUE_AFTER_ERROR combined with a fresh full backup taken directly to local disk (bypassing network storage) to isolate whether the original backup file is the root cause.

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

Troubleshooting Guide: SQL Server Error 3468 – Log Record Application Failure

Why This Error Happens

Error 3468 occurs during redo or undo operations when the SQL Server Storage Engine encounters a log record it cannot apply to a database page, typically because the transaction log or the database data file has become corrupted. This can result from abrupt storage failures, disk subsystem errors, faulty I/O filter drivers, or power loss during an active write operation. It frequently surfaces during crash recovery, log shipping, Always On Availability Group synchronization, or database restore operations when the log chain is broken or a page checksum mismatch is detected.

Step-by-Step Resolution Guide

Step 1: Examine the SQL Server Error Log for Context

  • Open SQL Server Management Studio (SSMS) and navigate to Management > SQL Server Logs, or review the raw log file located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Search for accompanying messages referencing Error 824 (page checksum failure) or Error 9004 (log corruption), which often precede or follow 3468.
  • Note the Database ID, File ID, and Page ID referenced in the error — this pinpoints the exact corrupted object.

Step 2: Run DBCC CHECKDB to Assess Corruption Scope

  • Open a new query window in SSMS and run:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for allocation or consistency errors tied to the same Page ID found in Step 1.
  • If corruption is confirmed, avoid further writes to the database until a recovery plan is finalized.

Step 3: Restore from a Known-Good Backup

  • Identify the last verified full backup and any subsequent differential/log backups using:
  RESTORE HEADERONLY FROM DISK = 'D:\Backups\YourDatabase_Full.bak';
  • Restore the database using WITH NORECOVERY, then apply transaction log backups sequentially, finishing with WITH RECOVERY.
  • If no clean backup exists, attempt DBCC CHECKDB ('YourDatabaseName') WITH REPAIR_ALLOW_DATA_LOSS only as a last resort, since this may discard corrupted pages permanently.

Step 4: Validate Underlying Storage Health

  • Check Windows Event Viewer under Windows Logs > System for Disk or NTFS warnings (Event ID 7, 51, or 153), which indicate hardware-level I/O failures.
  • Run chkdsk D: /f /r (replace with your data drive letter) during a scheduled maintenance window to repair file system-level errors.
  • If using virtualized or SAN storage, confirm with your storage administrator that no recent failover, snapshot rollback, or firmware update coincided with the corruption event.

Step 5: Reconfigure Log Shipping or Always On Settings (If Applicable)

  • If the error occurred during Always On Availability Group synchronization, remove the affected database from the availability group temporarily.
  • Re-initialize the secondary replica using a fresh full backup and re-join it to the AG via SSMS > Always On High Availability > Add Database.
  • For log shipping, re-establish the baseline by generating a new full backup and restoring it on the secondary server before resuming log backup jobs.

Alternative or Verification Steps

  • After restoring or repairing, re-run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS to confirm zero allocation or consistency errors are returned.
  • If corruption recurs on the same volume, run a full hardware diagnostic (e.g., Storage Diagnostic Tool or vendor-specific RAID utility) to rule out a failing disk before returning the database to production.

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

Why This Error Happens

Error 3467 occurs when a database using Always Encrypted with secure enclaves is restored, but the secure enclave (VBS-based or SGX-based) cannot access the column encryption keys needed to replay or roll back deferred transactions. This typically happens because the enclave attestation service is unreachable, the enclave was reset/rebooted after the backup was taken, or the column master key (CMK) provider does not have the enclave-enabled permissions required post-restore. Without a valid attestation handshake, SQL Server cannot decrypt the enclave-bound data needed to resolve the pending transactions.

Step-by-Step Resolution Guide

Step 1: Verify Attestation Service Connectivity

  • Confirm the Host Guardian Service (HGS) or Microsoft Azure Attestation (MAA) endpoint is reachable from the SQL Server instance.
  • Run Invoke-WebRequest -Uri "<attestation-url>/attest" from PowerShell on Windows Server 2025 to confirm a 200 response.
  • Check sys.dm_column_encryption_enclave_providers to confirm the attestation URL matches the server-level configuration (sp_configure 'column encryption enclave type').

Step 2: Re-establish the Enclave Session

  • Restart the SQL Server service to force a fresh enclave initialization: Restart-Service MSSQLSERVER.
  • If using VBS enclaves on Windows Server 2025, confirm Virtualization Based Security is enabled via msinfo32.exe (look for “Virtualization-based security: Running”).
  • Re-run the attestation policy check: Get-HgsAttestationBaselinePolicy (for HGS) to ensure the TPM baseline still matches the host.

Step 3: Resolve the Deferred Transactions Manually

  • Open SQL Server Management Studio (SSMS) and query sys.dm_tran_database_transactions to identify the deferred transaction IDs tied to the restored database.
  • Run DBCC OPENTRAN('YourDatabaseName') to confirm the oldest active transaction blocking resolution.
  • If the enclave keys are confirmed permanently inaccessible (e.g., CMK was deleted or rotated), use ALTER DATABASE SET ENCLAVE_COMPUTATIONS SUPPORTED = ON after re-provisioning the column master key via sp_configure and re-registering it in sys.column_master_keys.

Step 4: Rebuild the Column Master Key Enclave Bindings

  • Use PowerShell with the SqlServer module: Import-Module SqlServer then New-SqlColumnMasterKeySettings to recreate the enclave-compatible key metadata.
  • Re-run the original ALTER COLUMN ENCRYPTION KEY statement with the ENCLAVE_COMPUTATIONS clause to force SQL Server to regenerate the enclave session key.

Alternative or Verification Steps

  • To verify the fix, run DBCC OPENTRAN again — if it returns no active transactions, the deferred transactions have been successfully resolved.
  • If the enclave truly cannot be recovered (e.g., key material is permanently lost), restore from a backup taken before enclave encryption was enabled, then re-apply Always Encrypted with secure enclaves using a fresh CMK/CEK pair.

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

Troubleshooting Guide: Error 3466 — Deferred Transactions Unresolved Due to Unavailable Enclave Keys

Why This Error Happens

This error occurs when SQL Server restores a database that uses Always Encrypted with secure enclaves, but the deferred transactions in the transaction log require encryption keys that are not currently loaded into the secure enclave. The enclave is typically reinitialized after a service restart, failover, or restore operation, which clears any previously cached column encryption keys. Until the required keys are resent to the enclave using sp_enclave_send_keys, SQL Server cannot finish replaying or rolling back these deferred transactions because it cannot decrypt the enclave-protected data or key material involved.

Step-by-Step Resolution Guide

Step 1: Verify Enclave Configuration and Status

  • Confirm that the database is configured to use a secure enclave by checking sys.column_encryption_keys and sys.column_master_keys for enclave-enabled key entries.
  • Run the following to check enclave type configuration:
  SELECT * FROM sys.database_scoped_configurations WHERE name = 'PREEMPTIVE_ENCLAVE_TYPE';
  • Ensure the enclave attestation URL (for VBS or SGX enclaves) is reachable from Windows Server 2025 / Windows 11.

Step 2: Resend Encryption Keys to the Enclave

  • Open a new query window connected to the affected instance with a client driver that supports Always Encrypted with secure enclaves (ODBC 17.3+ or newer ADO.NET).
  • Execute sp_enclave_send_keys to push the required column encryption keys back into the enclave:
  EXEC sys.sp_enclave_send_keys
      @column_encryption_key = 0x0123456789ABCDEF...,
      @column_encryption_key_database_name = N'YourDatabaseName';
  • Confirm the key values match those stored in sys.column_encryption_keys to avoid key mismatch errors.

Step 3: Resolve the Deferred Transactions

  • After keys are successfully sent, manually trigger recovery to resolve pending transactions:
  ALTER DATABASE YourDatabaseName SET ONLINE;
  • If the database remains in a “Recovery Pending” or “Suspect” state, run:
  DBCC CHECKDB (YourDatabaseName) WITH NO_INFOMSGS;
  • Monitor SQL Server error logs (ERRORLOG in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\) for confirmation that deferred transactions have cleared.

Step 4: Restart the Enclave Host Process (If Required)

  • If keys fail to load even after sp_enclave_send_keys, restart the SQL Server service to reinitialize the VBS/SGX enclave host process.
  • Use PowerShell as Administrator:
  Restart-Service -Name 'MSSQLSERVER' -Force
  • Re-run Step 2 immediately after the service comes back online, since enclave state is cleared on every restart.

Alternative or Verification Steps

  • Verify resolution by querying sys.dm_tran_database_transactions to confirm no transactions remain in a deferred state for the affected database.
  • If the issue persists, consider performing a clean restore from a backup taken after the enclave keys were properly provisioned, avoiding partial or mid-transaction backup points.

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

Troubleshooting Guide: Error 3465 – Deferred Transaction Resolution Failure

Why This Error Happens

Error 3465 occurs when SQL Server’s transaction manager attempts to resolve a deferred transaction (typically during crash recovery or a distributed transaction rollback) but cannot locate the corresponding transaction entry in the log or the transaction table. This is most commonly caused by corruption in the transaction log, an abrupt termination of the SQL Server service during an active distributed transaction, or inconsistencies introduced by a failed failover in an Always On Availability Group. In rarer cases, manual intervention with DBCC commands or improper log truncation can strip the metadata needed to resolve the deferred transaction correctly.

Step-by-Step Resolution Guide

Step 1: Identify the Affected Database and Transaction Context

  • Check the SQL Server Error Log (Management > SQL Server Logs in SSMS) for the full error context surrounding Error 3465.
  • Run the following query to identify databases with pending deferred transactions:
  SELECT * FROM sys.dm_tran_database_transactions WHERE database_transaction_begin_time IS NOT NULL;
  • Note the Database ID and Transaction ID referenced in the error text.

Step 2: Check for MSDTC and Distributed Transaction Issues

  • Verify the Microsoft Distributed Transaction Coordinator (MSDTC) service is running on both Windows Server 2025 and Windows 11 clients:
  Get-Service MSDTC | Select-Object Status, StartType
  • If stopped, restart it: Start-Service MSDTC
  • Open dcomcnfg.exe, navigate to Component Services > Computers > My Computer > Distributed Transaction Coordinator > Local DTC, and confirm network DTC access is enabled under the Security tab.

Step 3: Run Database Consistency Checks

  • Execute DBCC CHECKDB against the affected database to identify log or page-level corruption:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is confirmed in the transaction log, take the database offline and restore from the last known good backup.
  • Avoid using REPAIR_ALLOW_DATA_LOSS unless no valid backup exists, as it can permanently discard unresolved transaction data.

Step 4: Force Transaction Resolution Manually (If Safe)

  • If the transaction is orphaned and confirmed non-recoverable, use sp_resolve_tranid or manually resolve it via KILL with the transaction UOW (Unit of Work):
  KILL '0000-00000000-0000000000000000';
  • Restart the SQL Server service afterward to clear any residual in-memory transaction table entries:
  Restart-Service MSSQLSERVER -Force

Step 5: Rebuild the Transaction Log (Last Resort)

  • If the log remains corrupted after recovery attempts, detach the database and rebuild the log file using ALTER DATABASE ... REBUILD LOG.
  • Only perform this step after taking a full file-level backup of the .mdf and .ldf files, as this operation can cause data loss for uncommitted transactions.

Alternative or Verification Steps

  • Verify the fix by querying sys.dm_tran_active_transactions to confirm no stale or orphaned transactions remain, and re-run DBCC CHECKDB to ensure the database reports zero allocation or consistency errors.
  • As an alternative, if the issue persists on Windows Server 2025 specifically, check for pending OS-level Cumulative Updates affecting MSDTC/COM+ components, as a known compatibility issue between SQL Server 2025 and certain Windows Server 2025 builds can intermittently disrupt distributed transaction resolution.

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

Troubleshooting Guide: SQL Server Error 3463 — Transaction Outcome Could Not Be Resolved

Why This Error Happens

Error 3463 occurs during the database recovery process when SQL Server encounters an in-doubt transaction tied to a distributed transaction coordinator (MS DTC) that cannot confirm whether the transaction should commit or roll back. This is commonly caused by a corrupted transaction log, an abrupt shutdown during a distributed transaction, or a mismatch between the database’s recovery state and the MS DTC log. In some cases, missing or damaged virtual log files (VLFs) within the transaction log prevent SQL Server from resolving the final state of the transaction.

Step-by-Step Resolution Guide

Step 1: Verify MS DTC Service Status

  • Open Services.msc on Windows Server 2025 / Windows 11 and confirm that Distributed Transaction Coordinator (MSDTC) is running.
  • If stopped, right-click and select Start, then set Startup Type to Automatic.
  • Run tracerpt or check Event Viewer under Applications and Services Logs > Microsoft > Windows > DistributedTransactionCoordinator for related failures.

Step 2: Attempt Manual Resolution of the In-Doubt Transaction

  • Open SQL Server Management Studio (SSMS) and run:
  SELECT * FROM sys.dm_tran_database_transactions WHERE database_id = DB_ID('YourDatabaseName');
  • Identify the transaction UOW (Unit of Work) ID causing the issue.
  • Use the following command to manually resolve the transaction:
  KILL '<UOW_GUID>'
  • If the GUID does not resolve, proceed to forcing recovery in Step 3.

Step 3: Force Database Recovery (If Transaction Cannot Be Resolved)

  • Take the database offline and attempt an emergency-mode repair:
  ALTER DATABASE YourDatabaseName SET EMERGENCY;
  ALTER DATABASE YourDatabaseName SET SINGLE_USER;
  DBCC CHECKDB (YourDatabaseName, REPAIR_ALLOW_DATA_LOSS);
  ALTER DATABASE YourDatabaseName SET MULTI_USER;
  • Warning: This step may result in data loss; ensure you have a verified backup before proceeding.

Step 4: Restore From a Clean Backup

  • If repair fails or data integrity is compromised, restore the database from the last known good full backup and subsequent transaction log backups located in your backup directory (e.g., D:\SQLBackups\).
  • Use:
  RESTORE DATABASE YourDatabaseName FROM DISK = 'D:\SQLBackups\YourDatabaseName.bak' WITH RECOVERY;

Alternative or Verification Steps

  • After applying fixes, run DBCC CHECKDB on the affected database with no repair options to confirm no further corruption exists.
  • If the error persists after recovery attempts, check Windows Event Viewer and SQL Server error logs (Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\LOG\ERRORLOG) for recurring DTC-related failures, and consider rebuilding the MS DTC configuration via msdtc -uninstall followed by msdtc -install.

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

Troubleshooting Guide: SQL Server Error 3464 — “An Error Occurred While Resolving the Deferred Transaction”

Why This Error Happens

Error 3464 occurs when SQL Server encounters an inconsistency while attempting to resolve a deferred transaction during crash recovery, typically caused by corrupted transaction log records or a damaged database file that prevents the rollback/roll-forward process from completing cleanly. This often happens after an unexpected shutdown, storage-level corruption, or a failing disk subsystem on Windows Server 2025 / Windows 11 that interrupted a transaction mid-write. In some cases, insufficient permissions on the SQL Server service account can also prevent proper access to the transaction log (.ldf) file, triggering this failure during database startup.

Step-by-Step Resolution Guide

Step 1: Check SQL Server Error Logs for Context

  • Open SQL Server Management Studio (SSMS) and navigate to Management > SQL Server Logs.
  • Alternatively, review the raw log file located at C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Look for the specific transaction ID and database name referenced alongside Error 3464 to identify the affected database.

Step 2: Verify Disk Integrity and File Permissions

  • Run chkdsk C: /f /r (or the appropriate drive letter hosting your .mdf/.ldf files) via an elevated Command Prompt, then restart the server to apply repairs.
  • Confirm the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control permissions on the data and log directories, typically C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA.
  • Check Windows Event Viewer under Windows Logs > System for any underlying disk or storage controller errors (Event ID 7 or 51).

Step 3: Attempt Database Recovery via DBCC CHECKDB

  • Open a new query window in SSMS and run:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is confirmed, take the database offline and attempt a repair:
  ALTER DATABASE YourDatabaseName SET EMERGENCY;
  DBCC CHECKDB ('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS);
  • Bring the database back online once repairs complete:
  ALTER DATABASE YourDatabaseName SET ONLINE;

Step 4: Restore from Backup if Repair Fails

  • If DBCC CHECKDB cannot resolve the deferred transaction, restore the database from the last known good full backup plus transaction log backups.
  • Use RESTORE DATABASE YourDatabaseName FROM DISK = 'D:\Backups\YourDatabase.bak' WITH RECOVERY; to bring the database to a consistent state.

Alternative or Verification Steps

  • After applying fixes, restart the SQL Server service (net stop MSSQLSERVER then net start MSSQLSERVER) and confirm the database comes online without Error 3464 reappearing in the ERRORLOG.
  • If the issue persists, run DBCC CHECKDB again with no repair option to confirm zero allocation/consistency errors, and consider engaging Microsoft Support if hardware-level corruption is suspected on the underlying Windows Server 2025 storage volume.

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

Troubleshooting Guide: SQL Server Error 3462 — “Redo Observed a Higher LSN on the PFS Page”

Why This Error Happens

This error occurs during the crash recovery (redo) phase when SQL Server detects that the Log Sequence Number (LSN) recorded on a Page Free Space (PFS) page is higher than what the transaction log expects to apply. This LSN mismatch typically indicates that the database files are corrupted, were not flushed to disk properly before a crash, or that storage-level write caching failed to honor a forced-flush (write-ordering) guarantee. It can also happen if a database was restored or copied improperly while transaction log redo was still pending, or if the underlying disk subsystem silently lost writes.

Step-by-Step Resolution Guide

Step 1: Verify the Scope of Corruption with DBCC CHECKDB

  • Take the database offline or ensure no further writes occur to avoid compounding the issue.
  • Run the following in SQL Server Management Studio (SSMS) or sqlcmd:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for allocation errors tied to PFS pages (look for page IDs matching the %S_PGID in the error log).

Step 2: Check Storage Subsystem and Disk Write-Caching Settings

  • Open Event Viewer (eventvwr.msc) on Windows Server 2025 / Windows 11 and inspect the System log for disk, storage, or controller errors around the time of the crash.
  • Confirm that disk write caching is disabled for volumes hosting .mdf and .ldf files, or that the storage controller has battery-backed/flash-backed cache enabled.
  • Validate disk health using:
  wevtutil qe System /q:"*[System[Provider[@Name='disk']]]" /f:text
  • If using virtualized or SAN storage, confirm the storage vendor’s SQL Server write-ordering compliance documentation.

Step 3: Restore from a Known Good Backup

  • If DBCC CHECKDB confirms unrecoverable corruption, restore the database from the most recent verified backup:
  RESTORE DATABASE [YourDatabaseName]
  FROM DISK = 'D:\Backups\YourDatabaseName.bak'
  WITH REPLACE, RECOVERY;
  • Apply any available transaction log backups in sequence to minimize data loss.
  • Avoid using REPAIR_ALLOW_DATA_LOSS on PFS page corruption unless no valid backup exists, as it can remove or zero out affected pages.

Step 4: Patch and Validate SQL Server Build

  • Confirm SQL Server 2025 is running the latest Cumulative Update (CU) via:
  SELECT @@VERSION;
  • Apply the latest CU from the Microsoft Update Catalog, as LSN/redo mismatches have historically been tied to specific recovery-engine bugs fixed in cumulative updates.
  • Restart the SQL Server service after patching: net stop MSSQLSERVER && net start MSSQLSERVER.

Alternative or Verification Steps

  • After recovery, re-run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; and confirm zero allocation or consistency errors.
  • If the error recurs on the same volume, migrate the database files to a different physical disk or LUN to rule out persistent hardware-level write failures.

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

Troubleshooting Guide: SQL Server Error 3461 – “Failed to wait for XTP %ls to complete during recovery”

Why This Error Happens

This error occurs when SQL Server’s In-Memory OLTP (XTP) engine cannot synchronize its recovery threads within the expected timeframe, typically due to corrupted or inconsistent checkpoint files associated with memory-optimized filegroups. It can also be triggered by insufficient system resources (CPU scheduling delays or memory pressure) that prevent XTP worker threads from completing their recovery tasks in time. In some cases, improper shutdowns or storage-level I/O failures leave the memory-optimized data/delta files in a state that the recovery process cannot reconcile.

Step-by-Step Resolution Guide

Step 1: Verify the Health of the Memory-Optimized Filegroup

  • Open SQL Server Management Studio (SSMS) and run sys.database_files to confirm the status of containers tied to the MEMORYOPTIMIZEDDATA filegroup.
  • Check the physical path of the filegroup containers (commonly under C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\XTP) to ensure the files are not missing, zero-byte, or marked read-only.
  • Look for underlying storage issues using Windows Event Viewer under Windows Logs > System for Disk or NTFS errors.

Step 2: Review SQL Server Error Log for Preceding XTP Events

  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Search for entries referencing “XTP” or “In-Memory OLTP” prior to Error 3461 to identify the specific checkpoint file group causing the stall.
  • Note any associated Error 3414 (recovery failure) that may indicate deeper corruption requiring a restore rather than a repair.

Step 3: Increase Recovery Timeout and Resource Allocation

  • Open SQL Server Configuration Manager and verify that Max Server Memory (configured via sp_configure 'max server memory') leaves sufficient headroom for the XTP memory-optimized data to load fully into RAM.
  • If running on Windows Server 2025, confirm the Hyper-V Dynamic Memory settings (if virtualized) are not throttling the VM during the recovery window.
  • Restart the SQL Server service via services.msc or PowerShell:
  Restart-Service -Name MSSQLSERVER -Force

Step 4: Rebuild or Restore the Memory-Optimized Filegroup

  • If corruption is confirmed via DBCC CHECKDB, take the database offline:
  ALTER DATABASE [YourDB] SET OFFLINE;
  • Restore the database from the last known good backup that predates the XTP corruption, ensuring the backup includes the memory-optimized filegroup.
  • If no clean backup exists, drop and recreate the memory-optimized filegroup and reload data from a non-XTP source table.

Step 5: Apply Latest Cumulative Update for SQL Server 2025

  • Check the installed build number via SELECT @@VERSION; and compare against the latest Cumulative Update (CU) on the Microsoft Update Catalog.
  • Install the latest CU, as XTP recovery threading issues are frequently patched in servicing releases.
  • Reboot the Windows Server 2025 host after installation to ensure all service dependencies reload cleanly.

Alternative or Verification Steps

  • After applying fixes, bring the database back online with ALTER DATABASE [YourDB] SET ONLINE; and confirm no Error 3461 reappears in the ERRORLOG during the startup recovery phase.
  • If the issue persists, run DBCC CHECKDB with DATA_PURITY on the affected database and consider exporting memory-optimized table data to disk-based staging tables as a temporary workaround while filegroup corruption is resolved.

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

Troubleshooting Guide: Error 3460 — Failed to Shutdown Database with Memory-Optimized Data

Why This Error Happens

Error 3460 occurs when SQL Server cannot safely checkpoint or flush the in-memory OLTP (memory-optimized) data to its corresponding filegroup before shutting down, often due to disk I/O failures, insufficient disk space on the memory-optimized filegroup container, or an abrupt termination of the SQL Server process that interrupted checkpoint operations. This can also happen if the underlying storage holding the memory-optimized filegroup becomes unavailable, corrupted, or is locked by another process (such as antivirus or backup software) during the shutdown sequence. Because memory-optimized tables rely on durable checkpoint files for recovery, any disruption to this process leaves the database in an inconsistent state that requires a clean restart and recovery cycle.

Step-by-Step Resolution Guide

Step 1: Verify Disk Space and Storage Health

  • Check the drive hosting the memory-optimized filegroup (MEMORYOPTIMIZEDDATA) for available free space using Get-PSDrive in PowerShell.
  • Confirm the storage volume is online and not in a degraded RAID/Storage Spaces state via Server Manager > File and Storage Services.
  • Review Windows Event Viewer (Application and System logs) for Disk or NTFS corruption warnings around the time of the failure.

Step 2: Restart SQL Server Service and Monitor Recovery

  • Open SQL Server Configuration Manager and restart the SQL Server (MSSQLSERVER) service.
  • Monitor the SQL Server Error Log (default path: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for recovery progress messages related to the affected database ID.
  • Allow sufficient time for the memory-optimized checkpoint files to be replayed; large memory-optimized tables may extend recovery duration significantly.

Step 3: Repair or Rebuild the Memory-Optimized Filegroup

  • If recovery fails repeatedly, take the database offline using ALTER DATABASE [YourDB] SET OFFLINE WITH ROLLBACK IMMEDIATE;.
  • Inspect the filegroup container path (commonly D:\SQLData\MemoryOptimized\) for missing or zero-byte checkpoint files (.chk, .xchk extensions).
  • If files are missing or corrupted beyond repair, restore the database from the most recent full backup plus transaction log backups using RESTORE DATABASE [YourDB] FROM DISK = 'BackupPath' WITH NORECOVERY, followed by log restores.

Step 4: Validate SQL Server Service Account Permissions

  • Confirm the SQL Server service account has Full Control NTFS permissions on the memory-optimized filegroup directory via Properties > Security tab in File Explorer.
  • Reapply permissions if they were reset during a Windows Server 2025 update or Group Policy refresh, using icacls "D:\SQLData\MemoryOptimized" /grant "NT SERVICE\MSSQLSERVER":(OI)(CI)F.

Alternative or Verification Steps

  • Run DBCC CHECKDB ('YourDB') WITH NO_INFOMSGS, ALL_ERRORMSGS; after recovery to confirm there is no residual corruption in the memory-optimized tables.
  • If the database still fails to come online, attach only the FILESTREAM/memory-optimized filegroup data to a test instance to isolate whether the corruption is limited to specific checkpoint file pairs, then selectively restore those tables from backup.

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

Troubleshooting Guide: SQL Server Error 3459 – Recovery Failed to Redo File Add

Why This Error Happens

Error 3459 occurs when the SQL Server transaction log contains a record of a file being added to the database (via ALTER DATABASE ADD FILE), but during the crash recovery or restore process, the engine cannot find the physical file at the expected path to replay that operation. This typically happens because the underlying .mdf, .ndf, or .ldf file was manually deleted, moved, or renamed outside of SQL Server after the ADD FILE transaction was committed to the log but before a checkpoint occurred. It can also surface in Windows Server 2025 environments where storage permissions (NTFS ACLs) or underlying disk/volume mappings changed between the time the log record was written and when recovery attempted to replay it.

Step-by-Step Resolution Guide

Step 1: Identify the Missing Physical File

  • Open the SQL Server Error Log (via SSMS > Management > SQL Server Logs, or ERRORLOG in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\) to find the exact file name and path referenced in the 3459 error message.
  • Use sqlcmd -S localhost -Q "RESTORE HEADERONLY FROM DISK = 'backup_path'" or check sys.master_files (if the instance is accessible in a limited state) to cross-reference the expected logical/physical file path.

Step 2: Restore or Recreate the Missing File

  • If the file was accidentally deleted, restore it from a Windows Server 2025 Volume Shadow Copy (VSS) snapshot or file-level backup to the exact original path (e.g., D:\SQLData\MyDB_NewFile.ndf).
  • If no backup of the physical file exists, create a placeholder file of the same logical name in the exact directory path cited in the error, as SQL Server only needs the file to exist to complete the redo operation; it will then allow you to properly resize or remove it afterward.
  • Ensure the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control NTFS permissions on the folder via Properties > Security in Windows Explorer or icacls D:\SQLData /grant "NT SERVICE\MSSQLSERVER":(OI)(CI)F.

Step 3: Retry Database Recovery

  • Take the database offline and back online via ALTER DATABASE [YourDB] SET OFFLINE; followed by ALTER DATABASE [YourDB] SET ONLINE; to force SQL Server to re-attempt crash recovery now that the file exists.
  • Alternatively, restart the SQL Server (MSSQLSERVER) service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER to trigger a fresh recovery cycle on startup.

Step 4: Remove the Orphaned File Reference (If Recovery Succeeds but File Is Unneeded)

  • Once the database is back online and stable, run ALTER DATABASE [YourDB] REMOVE FILE [LogicalFileName]; to cleanly drop the dummy/placeholder file reference from the database metadata.
  • Verify there is no critical data expected in that file by checking the file group assignment via sys.database_files.

Alternative or Verification Steps

  • Confirm the fix by querying SELECT state_desc, name, physical_name FROM sys.master_files WHERE database_id = DB_ID('YourDB'); — the state should read ONLINE for all files with no errors in the SQL Server Error Log.
  • If the placeholder file approach fails due to transaction log corruption, restore the entire database from the last known good full backup plus transaction log backups (RESTORE DATABASE ... WITH NORECOVERY then RESTORE LOG ... WITH RECOVERY) to bypass the corrupted redo operation entirely.

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

Troubleshooting Guide: Error 3457 — Transactional File System Resource Manager Failed to Recover

Why This Error Happens

Error 3457 occurs when SQL Server 2025 attempts to recover the Common Log File System (CLFS) resource manager associated with FILESTREAM or FileTable data, but the underlying transaction log or marshalling area is corrupted, missing, or inaccessible. This is commonly caused by abrupt shutdowns, storage-level corruption, or improper NTFS permissions on the $FSLOG stream and FILESTREAM data containers. It can also surface after an improper restore or migration where the FILESTREAM filegroup paths were moved without re-initializing the resource manager.

Step-by-Step Resolution Guide

Step 1: Verify FILESTREAM Service Configuration

  • Open SQL Server Configuration Manager and confirm FILESTREAM access is enabled for the instance (right-click the SQL Server service → Properties → FILESTREAM tab).
  • Ensure Windows-level FILESTREAM sharing is also enabled via sc.exe or the Services MMC console.
  • Confirm the SQL Server service account has Full Control NTFS permissions on the FILESTREAM data container path (e.g., D:\SQLData\FileStreamContainer).

Step 2: Inspect and Repair the CLFS Log Files

  • Navigate to the FILESTREAM container directory and locate the hidden $FSLOG alternate data stream — this cannot be viewed directly but is managed via CLFS.
  • Run chkdsk D: /f /r on the volume hosting the FILESTREAM data to rule out underlying disk corruption.
  • If corruption is confirmed, take the affected database offline using:
  ALTER DATABASE [YourDB] SET OFFLINE WITH ROLLBACK IMMEDIATE;
  • Bring it back online to force a recovery attempt:
  ALTER DATABASE [YourDB] SET ONLINE;

Step 3: Rebuild the Resource Manager (If Log Is Unrecoverable)

  • If recovery still fails, detach the database:
  EXEC sp_detach_db 'YourDB';
  • Rename or move the corrupted FILESTREAM container folder (this forces SQL Server to create a fresh $FSLOG on next attach).
  • Re-attach the database using CREATE DATABASE ... FOR ATTACH, then restore FILESTREAM data from the most recent full backup if the container was wiped.

Step 4: Apply Latest Cumulative Update

  • Confirm you are running the latest Cumulative Update (CU) for SQL Server 2025, as early builds have known CLFS recovery timing issues on Windows Server 2025.
  • Check build number with:
  SELECT @@VERSION;
  • Download and apply the latest CU from the Microsoft Update Catalog if outdated.

Alternative or Verification Steps

  • After recovery, run DBCC CHECKDB('YourDB') WITH ALL_ERRORMSGS and query sys.database_recovery_status to confirm the database and FILESTREAM filegroup are in a healthy, ONLINE state.
  • If the issue persists, restore the entire database (including FILESTREAM filegroups) from a known-good backup to a new container path rather than attempting in-place repair.