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

Troubleshooting Guide: SQL Server Error 674 (RowsetNewSS Destructor Exception)

Why This Error Happens

Error 674 occurs when SQL Server’s storage engine encounters an unhandled C++ exception while attempting to destroy a RowsetNewSS object, typically during the cleanup phase of a bulk-insert operation. This is most commonly triggered by corrupted or fragmented pre-allocated disk extents that the engine cannot properly deallocate, often due to underlying storage I/O failures, antivirus interference on data files, or a mismatch between the database’s expected allocation map and actual disk state. In rare cases, outdated storage drivers or filesystem-level corruption on Windows Server 2025/Windows 11 volumes hosting the .mdf/.ndf files can also trigger this fault.

Step-by-Step Resolution Guide

Step 1: Verify Disk and Storage Health

  • Open Event Viewer (eventvwr.msc) and check the System log for Disk or Ntfs warnings correlating with the SQL error timestamp.
  • Run chkdsk D: /f /r (replace D: with your data drive letter) during a maintenance window to repair filesystem-level corruption.
  • Confirm the storage controller drivers are up to date via Device Manager or vendor firmware tools.

Step 2: Run Database Consistency Checks

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Execute DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to detect allocation or page-level corruption.
  • If errors are returned, review recommended repair levels before proceeding (avoid REPAIR_ALLOW_DATA_LOSS unless a backup is confirmed).

Step 3: Exclude SQL Server Files from Antivirus/Defender Scanning

  • Navigate to Windows Security > Virus & threat protection > Manage settings > Exclusions.
  • Add exclusions for C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA\ (adjust path/version as needed) and the sqlservr.exe process.
  • Restart the SQL Server (MSSQLSERVER) service via services.msc to apply changes cleanly.

Step 4: Adjust Bulk-Insert Batch Configuration

  • Reduce the BATCHSIZE parameter in your BULK INSERT or bcp commands to lower memory/disk pressure during large imports.
  • Ensure TABLOCK and ROWS_PER_BATCH hints are set appropriately to avoid excessive pre-allocation of extents in a single transaction.

Step 5: Restart the SQL Server Service (Temporary Fix)

  • As advised in the error message, restart the instance: net stop MSSQLSERVER && net start MSSQLSERVER.
  • Monitor the SQL Server Error Log (ERRORLOG file in the LOG directory) immediately after restart to confirm the exception does not recur during the next bulk operation.

Alternative or Verification Steps

  • Re-run the same bulk-insert operation that originally triggered Error 674 and monitor sys.dm_exec_requests for wait types like PREEMPTIVE_OS_WRITEFILEGATHER to confirm disk I/O is no longer stalling.
  • If the error persists after all steps, restore the affected database from the last known-good backup to a test instance and re-attempt the bulk load to isolate whether the issue is data-specific or environment-specific.