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

Troubleshooting Guide: Service Broker Error 5840 – Invalid Message Forward Mode

Why This Error Happens

Error 5840 occurs when the Service Broker’s message forwarding configuration contains an invalid or unsupported value, typically caused by corrupted route metadata or an improperly configured FORWARD_MESSAGES setting at the endpoint level. This can also result from a failed SQL Server upgrade process where legacy broker configurations from an older instance did not migrate cleanly into SQL Server 2025. In some cases, manual edits to system catalogs (such as sys.routes or sys.service_broker_endpoints) introduce inconsistent state that the Broker engine cannot interpret correctly.

Step-by-Step Resolution Guide

Step 1: Verify Current Broker Endpoint Configuration

  • Open SQL Server Management Studio (SSMS) and connect to your Windows Server 2025 instance.
  • Run the following query to inspect current forwarding settings:
  SELECT name, is_message_forwarding_enabled, message_forwarding_size 
  FROM sys.service_broker_endpoints;
  • Confirm whether is_message_forwarding_enabled holds an unexpected or NULL value.

Step 2: Reset the Message Forwarding Mode

  • Disable and reconfigure the forwarding option explicitly rather than leaving it in a default/ambiguous state.
  • Execute the following T-SQL command:
  ALTER ENDPOINT [ServiceBrokerEndpoint]
  FOR SERVICE_BROKER (MESSAGE_FORWARDING = DISABLED);
  • If forwarding is required for your environment, re-enable it with explicit sizing:
  ALTER ENDPOINT [ServiceBrokerEndpoint]
  FOR SERVICE_BROKER (MESSAGE_FORWARDING = ENABLED, MESSAGE_FORWARD_SIZE = 10);

Step 3: Rebuild Corrupted Route Entries

  • Navigate to the affected database and drop any routes referencing invalid forwarding states.
  DROP ROUTE [BrokenRouteName];
  • Recreate the route with correct parameters pointing to the valid broker instance:
  CREATE ROUTE [FixedRoute]
  WITH SERVICE_NAME = '//YourApp/Service',
  ADDRESS = 'TCP://ServerName:4022';

Step 4: Restart the SQL Server Service

  • On Windows Server 2025, open Services.msc.
  • Locate SQL Server (MSSQLSERVER) or your named instance.
  • Right-click and select Restart to clear any cached broker session states tied to the invalid forward mode.

Alternative or Verification Steps

  • To verify the fix, re-run the sys.service_broker_endpoints query from Step 1 and confirm is_message_forwarding_enabled now returns a valid boolean (0 or 1) rather than an inconsistent value; also check the SQL Server Error Log for the absence of further Error 5840 entries after restart.
  • If the error persists, consider dropping and fully recreating the Service Broker endpoint from scratch using CREATE ENDPOINT, as this bypasses any residual corrupted configuration that ALTER commands cannot overwrite.

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

Troubleshooting Guide: SQL Server Error 5839 – Service Broker Message Forward Store Size Cannot Be Set to 0

Why This Error Happens

Error 5839 occurs when Service Broker attempts to configure the message forwarding store with a size value of 0, which SQL Server 2025 treats as an invalid configuration because the forwarding store requires a minimum allocation to buffer in-transit messages. This typically happens due to a misconfigured sp_configure setting, a corrupted msdb or Service Broker system catalog, or an automated deployment script that incorrectly passes a zero value during instance provisioning. It can also surface after an in-place upgrade from an older SQL Server version where legacy Service Broker settings were not properly migrated.

Step-by-Step Resolution Guide

Step 1: Verify Current Service Broker Configuration

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Run SELECT * FROM sys.databases WHERE is_broker_enabled = 1; to confirm Service Broker status.
  • Check the forwarding store setting using EXEC sp_configure 'Service Broker forward message size';.

Step 2: Correct the Forward Message Store Size Value

  • Run the following T-SQL to reset the value to a supported minimum (never 0):
  • EXEC sp_configure 'show advanced options', 1; RECONFIGURE;
  • EXEC sp_configure 'Service Broker forward message size', 4096; RECONFIGURE;
  • Restart the SQL Server service via services.msc or run NET STOP MSSQLSERVER && NET START MSSQLSERVER in an elevated Command Prompt on Windows Server 2025.

Step 3: Inspect and Repair Deployment or Configuration Scripts

  • Locate any PowerShell or DSC (Desired State Configuration) scripts under C:\SQLConfig\ or your CI/CD pipeline repository that provision the instance.
  • Search for parameters like -BrokerForwardSize 0 or similar JSON/XML config keys and update them to a non-zero value (e.g., 4096 or higher).
  • Redeploy the configuration using Invoke-SqlCmd or your orchestration tool to ensure the corrected value persists.

Step 4: Rebuild the Service Broker GUID (If Corruption Is Suspected)

  • Run ALTER DATABASE [YourDatabase] SET NEW_BROKER; to reset a corrupted broker identifier.
  • Follow with ALTER DATABASE [YourDatabase] SET ENABLE_BROKER; to reactivate messaging.
  • Confirm no orphaned conversation endpoints remain using SELECT * FROM sys.conversation_endpoints;.

Alternative or Verification Steps

  • After applying changes, run SELECT * FROM sys.configurations WHERE name = 'Service Broker forward message size'; and confirm the value_in_use column shows a non-zero number.
  • If the error persists, restore the msdb database from a known-good backup taken prior to the misconfiguration, then reapply Step 2 before bringing the instance back online.

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

Troubleshooting Guide: SQL Server Error 5838 — Invalid Service Broker Connection Authentication Value

Why This Error Happens

This error occurs when the Service Broker endpoint receives a connection authentication value that does not match any of the supported authentication mechanisms (NTLM, Kerberos, or Certificate-based authentication). It is typically caused by a mismatch between the AUTHENTICATION clause defined on the Service Broker endpoint and the actual security context being used by the connecting instance, often introduced after a certificate rotation, domain trust change, or manual endpoint reconfiguration. Corrupted or expired certificates bound to the endpoint, as well as inconsistent Windows authentication protocols between Windows Server 2025 and Windows 11 clients, can also trigger this value mismatch.

Step-by-Step Resolution Guide

Step 1: Verify the Service Broker Endpoint Configuration

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Run SELECT * FROM sys.service_broker_endpoints; to inspect the current AUTHENTICATION and ENCRYPTION settings.
  • Confirm whether the endpoint is set to WINDOWS NEGOTIATE, WINDOWS KERBEROS, WINDOWS NTLM, or CERTIFICATE, and check if this matches the expected setting on the partner instance.

Step 2: Realign Authentication Settings Between Instances

  • On both the initiator and target instances, run the following to reset authentication to a consistent value:
  ALTER ENDPOINT [ServiceBrokerEndpoint]
  FOR SERVICE_BROKER (AUTHENTICATION = WINDOWS NEGOTIATE, ENCRYPTION = REQUIRED ALGORITHM AES);
  • Ensure both servers are using the same domain trust relationship if using Windows-based authentication.
  • If using certificates, verify they have not expired via SELECT name, expiry_date FROM sys.certificates;.

Step 3: Re-issue or Re-bind Certificates (If Using Certificate Authentication)

  • Navigate to the certificate store via certlm.msc on Windows Server 2025 to confirm the certificate used by Service Broker is present and valid.
  • Drop and recreate the certificate binding using:
  CREATE CERTIFICATE ServiceBrokerCert
  WITH SUBJECT = 'Service Broker Certificate';
  • Re-bind the new certificate to the endpoint and restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.

Step 4: Restart the Service Broker and Clear Cached Sessions

  • Run ALTER DATABASE [YourDB] SET NEW_BROKER; only if conversations are non-critical, as this resets the Broker GUID.
  • Alternatively, use ALTER DATABASE [YourDB] SET ENABLE_BROKER; followed by a service restart to clear stale authentication tokens.
  • Check the SQL Server error log (ERRORLOG in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\) for confirmation that Error 5838 no longer appears.

Alternative or Verification Steps

  • Verify the fix by querying SELECT * FROM sys.conversation_endpoints; to confirm conversations are establishing successfully without authentication failures.
  • If the issue persists, temporarily set the endpoint AUTHENTICATION = WINDOWS without specifying NTLM/Kerberos explicitly, allowing SQL Server to negotiate automatically between Windows Server 2025 and Windows 11 clients.

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

Troubleshooting Guide: SQL Server Error 5837 – Service Broker Listen Port Cannot Be Dynamic

Why This Error Happens

This error occurs when the ALTER DATABASE SET ENABLE_BROKER or CREATE ENDPOINT statement attempts to configure the Service Broker listener using a port value set to 0 or outside the valid TCP port range. SQL Server 2025 strictly requires a static port between 1024 and 32767 for Service Broker communication, as dynamic port allocation (used by protocols like named pipes) is not supported for this endpoint type. This typically happens due to a misconfigured connection string, a leftover default value from a migration script, or manual editing of endpoint metadata that introduced an invalid port number.

Step-by-Step Resolution Guide

Step 1: Identify the Current Broker Endpoint Configuration

  • Open SQL Server Management Studio (SSMS) and connect to the target instance on your Windows Server 2025 host.
  • Run the following query to inspect existing endpoints:
  SELECT name, port, protocol_desc, state_desc 
  FROM sys.tcp_endpoints;
  • Look for any NULL, 0, or out-of-range values in the port column associated with the SERVICE_BROKER protocol.

Step 2: Drop the Invalid Endpoint

  • If an invalid or dynamically-assigned endpoint exists, remove it before recreating it correctly.
  • Execute the following, replacing EndpointName with the actual name retrieved in Step 1:
  DROP ENDPOINT EndpointName;
  • Confirm no errors are returned and that the endpoint no longer appears in sys.tcp_endpoints.

Step 3: Recreate the Endpoint with a Valid Static Port

  • Choose an unused port within the 1024–32767 range (e.g., 4022, a common default for Service Broker).
  • Run the creation script explicitly defining the port:
  CREATE ENDPOINT ServiceBrokerEndpoint
  STATE = STARTED
  AS TCP (LISTENER_PORT = 4022)
  FOR SERVICE_BROKER (AUTHENTICATION = WINDOWS NEGOTIATE, ENCRYPTION = REQUIRED);
  • Ensure this port is not already bound by another application; check using netstat -ano | findstr "4022" in an elevated Command Prompt on Windows Server 2025.

Step 4: Open the Port in Windows Defender Firewall

  • Navigate to Windows Defender Firewall with Advanced Security on the server.
  • Create a new Inbound Rule for the specific TCP port (e.g., 4022) to allow SQL Server Service Broker traffic.
  • Restart the SQL Server (MSSQLSERVER) service via services.msc or by running net stop MSSQLSERVER && net start MSSQLSERVER in an elevated terminal.

Alternative or Verification Steps

  • Verify the fix by re-running SELECT * FROM sys.tcp_endpoints WHERE protocol = 'TCP'; and confirming the port column shows a static, valid integer (e.g., 4022) rather than NULL or 0.
  • If the error persists, check for duplicate Broker configurations across linked databases using SELECT name, is_broker_enabled FROM sys.databases; and ensure no conflicting GUID mismatches exist between the service_broker_guid values.

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

Troubleshooting Guide: Error 5836 – Lightweight Pooling Not Supported

Why This Error Happens

This error occurs when the lightweight pooling configuration option is enabled via sp_configure, but the running instance of SQL Server 2025 does not support fiber-mode scheduling. Lightweight pooling has been deprecated and is restricted on most modern editions and platforms, meaning the setting is effectively obsolete even though it may still appear as a configurable option. Attempting to apply this value triggers Error 5836 because the SQL Server engine rejects fiber-based scheduling on current Windows Server 2025/Windows 11 architectures.

Step-by-Step Resolution Guide

Step 1: Verify Current Configuration Value

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Run EXEC sp_configure 'lightweight pooling'; to check if the value is set to 1.
  • Confirm the run_value column reflects an active (non-zero) setting.

Step 2: Disable Lightweight Pooling

  • Execute the following T-SQL commands:
  • EXEC sp_configure 'show advanced options', 1; RECONFIGURE;
  • EXEC sp_configure 'lightweight pooling', 0;
  • RECONFIGURE;
  • This resets the scheduling mode back to standard thread-based scheduling, which is fully supported.

Step 3: Restart the SQL Server Service

  • Open Services.msc on Windows Server 2025 or Windows 11.
  • Locate SQL Server (MSSQLSERVER) or the named instance service.
  • Right-click and select Restart to apply the configuration change.
  • Alternatively, run net stop MSSQLSERVER && net start MSSQLSERVER from an elevated Command Prompt.

Step 4: Check SQL Server Error Logs

  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Confirm no further references to Error 5836 appear after the restart.
  • Look for the startup message confirming standard thread-mode scheduling is active.

Step 5: Audit Deployment Scripts and Legacy Configurations

  • Search any automated deployment or configuration scripts (PowerShell, DSC, or T-SQL baseline scripts) for references to lightweight pooling.
  • Remove or comment out any legacy configuration commands tied to fiber-mode scheduling to prevent recurrence during future deployments.

Alternative or Verification Steps

  • Run SELECT * FROM sys.configurations WHERE name = 'lightweight pooling'; and confirm both value and value_in_use are set to 0.
  • If the error persists after disabling the setting, check for third-party monitoring tools or legacy maintenance plans that may be resetting the configuration value on a schedule.

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

Troubleshooting Guide: SQL Server Error 5835 — “Failed to start CPUs with the mask 0x%lx on the system”

Why This Error Happens

This error occurs when SQL Server 2025 attempts to bind its scheduler threads to specific CPUs during startup based on an affinity mask configuration (via sp_configure or ALTER SERVER CONFIGURATION), but the Windows Server 2025 / Windows 11 kernel reports that those logical processors are unavailable, disabled, or do not exist on the current hardware/VM topology. This commonly happens after a VM is reconfigured with fewer vCPUs, a physical CPU is swapped, a NUMA node is removed, or a BIOS/hypervisor setting restricts the processor group exposed to the OS, leaving a stale affinity mask in the SQL Server configuration that references non-existent CPUs. It can also arise from corrupted or mismatched soft-NUMA configuration files referenced by startup parameters.

Step-by-Step Resolution Guide

Step 1: Identify the Current CPU Topology

  • Open an elevated PowerShell prompt and run Get-WmiObject Win32_Processor | Select-Object NumberOfCores, NumberOfLogicalProcessors.
  • Cross-check this against Task Manager > Performance > CPU to confirm the actual number of logical processors exposed to the OS.
  • Compare this to the CPU affinity mask currently configured in SQL Server.

Step 2: Reset the SQL Server Affinity Mask

  • Start SQL Server in minimal configuration mode by launching it from the command line with the -f flag, e.g., sqlservr.exe -f -c from the C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Binn directory.
  • Once connected via SQLCMD or SSMS, run EXEC sp_configure 'show advanced options', 1; RECONFIGURE; followed by EXEC sp_configure 'affinity mask', 0; RECONFIGURE; to clear the stale mask.
  • Alternatively, reset affinity via ALTER SERVER CONFIGURATION SET PROCESS AFFINITY CPU = AUTO; to let SQL Server auto-detect available CPUs.

Step 3: Validate Soft-NUMA and Startup Parameters

  • Check the SQL Server error log directory (default: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log) for any -K or NUMA-related startup trace flags that may reference removed CPU nodes.
  • Open SQL Server Configuration Manager, navigate to SQL Server Services > right-click the instance > Properties > Startup Parameters, and remove any manually added affinity or NUMA startup flags that no longer match hardware.
  • Restart the SQL Server service normally (not in -f mode) via Restart-Service MSSQLSERVER -Force.

Step 4: Update Hypervisor/VM CPU Allocation (If Applicable)

  • If running on Hyper-V or another hypervisor, confirm the VM’s assigned vCPU count matches what SQL Server expects by checking VM Settings > Processor in Hyper-V Manager.
  • Increase vCPU count or re-enable disabled cores if the mask requires more processors than currently assigned.

Alternative or Verification Steps

  • After restarting the service, verify success by checking the SQL Server error log for the message “SQL Server detected X sockets with Y cores per socket” without any accompanying 5835 error.
  • If the issue persists, run DBCC CPU (or query sys.dm_os_schedulers for status = 'VISIBLE ONLINE') to confirm all expected schedulers are active and match the physical/virtual CPU count.

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

Troubleshooting Guide: SQL Server Error 5834 — Affinity Mask Conflict

Why This Error Happens

This error occurs because SQL Server 2025 detects an overlap between the CPUs assigned via affinity mask (or affinity64 mask) and the CPUs assigned via affinity I/O mask. Each CPU core on the host can only be dedicated to one function at a time—either general query processing or dedicated I/O operations—and SQL Server enforces mutual exclusivity between these two pools. This typically happens after a manual edit to sp_configure values or when a server is migrated/reconfigured with a different CPU core count than the original affinity script was written for.

Step-by-Step Resolution Guide

Step 1: Identify the Current Affinity Configuration

  • Open SQL Server Management Studio (SSMS) and connect to the instance via a new query window.
  • Run EXEC sp_configure 'show advanced options', 1; RECONFIGURE; to unlock advanced settings.
  • Run EXEC sp_configure 'affinity mask'; and EXEC sp_configure 'affinity I/O mask'; to view the current bitmask values (or check affinity64 mask / affinity64 I/O mask on 64-bit NUMA systems).
  • Cross-reference these decimal/binary values against Task Manager’s Performance > CPU tab on Windows Server 2025 to map which logical processors are currently assigned to which pool.

Step 2: Recalculate Non-Overlapping CPU Masks

  • Convert both masks to binary and manually check for bit overlap (e.g., if CPU 0–3 are in affinity mask, they cannot also appear in affinity I/O mask).
  • Use the GUI method instead of manual bitmasking: open SSMS > Right-click Server > Properties > Processors tab.
  • In the Processors tab, uncheck any CPU under “Automatically set processor affinity mask for all processors” and manually assign distinct checkboxes for “Processor Affinity” vs. “I/O Affinity” columns, ensuring no single CPU row has both boxes checked.

Step 3: Apply Configuration via T-SQL (Alternative to GUI)

  • If the GUI fails to save due to the same conflict, reset both values to 0 first to clear the conflicting state:
  • Run EXEC sp_configure 'affinity mask', 0; RECONFIGURE;
  • Run EXEC sp_configure 'affinity I/O mask', 0; RECONFIGURE;
  • Re-apply the corrected, non-overlapping decimal values calculated in Step 2 for each setting individually, running RECONFIGURE after each command.

Step 4: Restart the SQL Server Service

  • Open Services.msc on Windows Server 2025.
  • Locate SQL Server (MSSQLSERVER) or the specific named instance.
  • Right-click and select Restart to apply the new kernel-level affinity bindings, as these changes do not take effect dynamically without a service restart in most configurations.

Alternative or Verification Steps

  • Verify the Fix: After the restart, check the SQL Server Error Log (via SSMS > Management > SQL Server Logs) for the startup message confirming “affinity mask” and “I/O affinity mask” values were loaded without a 5834 error.
  • Alternative Fix: If manual calculation is too complex, reset both affinity mask and affinity I/O mask to 0 via T-SQL and leave “Automatically set processor affinity mask for all processors” checked in the GUI; this allows SQL Server to dynamically manage core allocation without manual mask conflicts.

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

Troubleshooting Guide: SQL Server Error 5833 – Affinity Mask Exceeds Licensed CPU Limit

Why This Error Happens

This error occurs because the ALTER SERVER CONFIGURATION command is attempting to set a CPU affinity mask that includes processor cores beyond what your specific SQL Server 2025 edition is licensed to use. Editions like Standard or Web have hard-coded limits on the number of cores/sockets they can utilize, regardless of how many physical cores exist on the Windows Server 2025 host. This typically happens after a hardware upgrade, a VM resource increase, or a migration where the server now has more logical processors than the SQL Server license tier supports.

Step-by-Step Resolution Guide

Step 1: Verify Your SQL Server Edition and Core Limits

  • Run SELECT SERVERPROPERTY('Edition') in SSMS to confirm your current edition.
  • Cross-reference this with Microsoft’s official “Compute capacity limits by edition” documentation for SQL Server 2025.
  • Note the maximum number of cores/sockets allowed (e.g., Standard Edition is typically capped at the lesser of 4 sockets or 24 cores).

Step 2: Check the Current Affinity Configuration

  • Open a new query window in SQL Server Management Studio (SSMS).
  • Execute EXEC sp_configure 'show advanced options', 1; RECONFIGURE; followed by EXEC sp_configure 'affinity mask'; to view legacy settings.
  • For modern setups, check sys.dm_os_nodes or Server Properties > Processors tab in SSMS to see which CPUs are currently flagged for use.

Step 3: Reset the Affinity Mask to Auto

  • If the mask was manually set incorrectly, reset it to allow SQL Server to auto-manage based on license limits.
  • Run the following T-SQL command to clear the restrictive mask:
  ALTER SERVER CONFIGURATION SET PROCESS AFFINITY MASK = AUTO;
  • Alternatively, right-click the Server instance in SSMS, go to Properties > Processors, and ensure “Automatically set processor affinity mask for all processors” is checked.

Step 4: Manually Align Affinity with Licensed Cores

  • If you need specific cores active (rather than “Auto”), ensure the CPU mask selects a number of cores equal to or less than your license limit.
  • Use the GUI method: In SSMS Server Properties > Processors, manually check boxes only up to your licensed limit (e.g., if licensed for 16 cores, do not check core 17 or higher).
  • Avoid using the deprecated sp_configure 'affinity mask' for systems with more than 32 logical processors, as it uses a bitmask that cannot address higher core counts; use ALTER SERVER CONFIGURATION instead.

Step 5: Restart the SQL Server Service

  • Navigate to SQL Server Configuration Manager.
  • Right-click the SQL Server (MSSQLSERVER) service and select Restart to apply the new affinity configuration.
  • Monitor the SQL Server Error Log immediately following the restart to ensure Error 5833 does not reappear.

Alternative or Verification Steps

  • Verification: After the restart, query SELECT cpu_id, scheduler_id, is_online FROM sys.dm_os_schedulers WHERE status = 'VISIBLE ONLINE'; to confirm the number of active schedulers matches your licensed core count.
  • Alternative Fix: If you require more cores than your current edition allows, you must either upgrade to SQL Server 2025 Enterprise Edition or use Windows Server 2025 Hyper-V to partition the VM/Host to match the exact core count of your SQL license before reapplying the affinity settings.

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

Why This Error Happens

Error 5832 occurs when the affinity mask or affinity64 mask value configured in SQL Server’s startup settings references CPU bits that do not exist on the current hardware or virtual machine configuration. This commonly happens after migrating a database instance to a new host, restoring a configuration from a backup, or reducing the number of vCPUs assigned to a VM without updating SQL Server’s sp_configure settings. Since SQL Server 2025 validates the affinity mask against the actual CPU topology reported by Windows Server 2025 at startup, any mismatch between the configured bitmask and the physical/logical processor count triggers this fatal configuration error.

Step-by-Step Resolution Guide

Step 1: Boot SQL Server in Minimal Configuration Mode

  • Since the affinity mask error can prevent the SQL Server service from starting normally, you must start it in a safe state to regain access.
  • Open an elevated Command Prompt and stop the SQL Server service: NET STOP MSSQLSERVER
  • Start the instance using the -f (minimal configuration) startup parameter: NET START MSSQLSERVER /f

Step 2: Reset the Affinity Mask via SQLCMD

  • Connect to the instance using SQLCMD since SSMS may be unable to initialize advanced options in minimal mode.
  • Run the following commands to reset the affinity values to zero (default, OS-managed scheduling):
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure 'affinity mask', 0;
EXEC sp_configure 'affinity64 mask', 0;
RECONFIGURE;
  • This clears the manual CPU binding, allowing SQL Server to use all available schedulers detected by the OS.

Step 3: Verify the Current CPU Topology

  • Before re-applying any manual affinity settings, confirm how many logical processors Windows Server 2025 actually exposes to the instance.
  • Run Get-WmiObject Win32_Processor | Select-Object NumberOfLogicalProcessors in PowerShell, or check sys.dm_os_schedulers in SQL Server.
  • If you are running inside a Hyper-V or Azure VM, verify the vCPU count assigned in the VM settings matches what the guest OS reports.

Step 4: Re-apply Affinity Settings Correctly (Optional)

  • If specific CPU affinity is required for licensing or NUMA alignment, use the ALTER SERVER CONFIGURATION command instead of the deprecated bitmask method, as it is less prone to mismatch errors.
  • Example: ALTER SERVER CONFIGURATION SET PROCESS AFFINITY CPU = AUTO;
  • Restart the SQL Server service normally once the correct values are set: NET STOP MSSQLSERVER followed by NET START MSSQLSERVER

Alternative or Verification Steps

  • Verify the fix by checking the SQL Server Error Log (ERRORLOG file in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\) for successful service startup without Error 5832 reappearing.
  • If the issue persists after resetting the mask, check for Group Policy or BIOS/Hyper-V settings that may be dynamically altering the number of logical processors exposed to the OS during reboot cycles.

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

Troubleshooting Guide: SQL Server Error 5831

Why This Error Happens

This error occurs when the min server memory configuration value is set higher than the max server memory value in SQL Server’s memory configuration, violating the engine’s internal validation rule. This typically happens due to manual misconfiguration via sp_configure, an automated deployment script applying values in the wrong order, or a failed migration process that left memory settings in an inconsistent state. SQL Server 2025 strictly enforces that minimum memory cannot exceed maximum memory, and will reject the configuration change or fail to start the memory manager correctly until corrected.

Step-by-Step Resolution Guide

Step 1: Verify Current Memory Configuration Values

  • Open SQL Server Management Studio (SSMS) or connect via sqlcmd on your Windows Server 2025 / Windows 11 instance.
  • Run the following query to inspect current settings:
  EXEC sp_configure 'show advanced options', 1;
  RECONFIGURE;
  EXEC sp_configure 'min server memory';
  EXEC sp_configure 'max server memory';
  • Note the current values (config_value and run_value) for both parameters.

Step 2: Correct the Max Server Memory Value First

  • Always set max server memory before adjusting min server memory to avoid the conflict.
  • Run:
  EXEC sp_configure 'max server memory', 8192; -- example: 8 GB in MB
  RECONFIGURE WITH OVERRIDE;
  • Ensure this value is appropriate for your physical RAM, leaving enough headroom for the OS (typically 2-4 GB reserved for Windows Server 2025).

Step 3: Set Min Server Memory to a Valid Value

  • Set min server memory to a value less than or equal to the corrected max server memory.
  • Run:
  EXEC sp_configure 'min server memory', 2048; -- example: 2 GB in MB
  RECONFIGURE WITH OVERRIDE;
  • Confirm the change applied without triggering Error 5831.

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

  • Open Services.msc on Windows Server 2025 / Windows 11.
  • Locate SQL Server (MSSQLSERVER) or your named instance.
  • Right-click and select Restart to ensure the new memory configuration is fully applied at the engine level.

Alternative or Verification Steps

  • Re-run EXEC sp_configure 'min server memory'; and EXEC sp_configure 'max server memory'; to confirm min is now less than or equal to max in both config_value and run_value columns.
  • If the error persists after reconfiguration, check the SQL Server Error Log (via SSMS > Management > SQL Server Logs) for conflicting startup parameters or use sp_configure with explicit values in a single transaction to avoid race conditions during automated deployment scripts.

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

Troubleshooting Guide: SQL Server Error 5829 – “The Specified User Options Value Is Invalid”

Why This Error Happens

Error 5829 occurs when the sp_configure ‘user options’ value submitted falls outside the valid range (0–32767) or represents an invalid combination of bitmask flags for setting default query processing options. This typically results from an administrator manually calculating an incorrect bitmask sum when attempting to set multiple SET options (such as ANSI_WARNINGS, ARITHABORT, or NOCOUNT) globally at the server level. It can also occur due to corrupted or manually edited registry values associated with the SQL Server instance configuration.

Step-by-Step Resolution Guide

Step 1: Verify the Current User Options Configuration

  • Open SQL Server Management Studio (SSMS) and connect to the instance running on Windows Server 2025 or Windows 11.
  • Run the following query to check the current value:
EXEC sp_configure 'user options';
  • Confirm the run_value and config_value columns to see if an out-of-range number (e.g., anything above 32767) is present.

Step 2: Recalculate the Correct Bitmask Value

  • Reference the official bitmask table for SET options (e.g., DISABLEDEFCNSTCHK = 1, IMPLICITTRANSACTIONS = 2, CURSORCLOSEONCOMMIT = 4, ANSIWARNINGS = 8, etc.).
  • Manually add only the specific decimal values for the options you want active.
  • Ensure the total sum does not exceed 32767, as this is the maximum allowable integer for this configuration.

Step 3: Apply the Corrected Configuration Value

  • Execute the corrected value using the following T-SQL syntax (replace 4096 with your calculated value):
EXEC sp_configure 'user options', 4096;
RECONFIGURE;
  • If the error persists immediately after running this, restart the SQL Server (MSSQLSERVER) service via the Services console (services.msc) or SQL Server Configuration Manager to force the engine to re-read the configuration cache.

Step 4: Check for Registry Corruption (If Error Persists)

  • Navigate to the registry path: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\[Instance_Name]\MSSQLServer.
  • Look for the UserConnect or related configuration keys that might contain a non-numeric or invalid data type.
  • If corruption is found, it is safer to reset the specific configuration value via T-SQL (Step 3) rather than editing the registry directly, as SQL Server 2025 may overwrite manual registry edits upon service restart.

Alternative or Verification Steps

  • Verification: After restarting the service, run EXEC sp_configure 'user options'; again. The run_value should now match the config_value you set, and no error should populate in the SQL Server Error Log (viewable via SSMS Object Explorer > Management > SQL Server Logs).
  • Alternative: If the global server-level setting continues to throw errors, reset it to the default value of 0 and instead manage SET options at the connection string or application level (e.g., via ADO.NET or ODBC connection properties) to avoid overriding server-wide session defaults.

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

Troubleshooting Guide: SQL Server Error 5828 — “User Connections Are Limited to %d”

Why This Error Happens

This error occurs when SQL Server 2025 reaches the configured ceiling for the user connections setting, which caps the maximum number of simultaneous user connections the instance will accept. It can happen because an administrator manually set a low, fixed value in sp_configure, or because the system calculated a default limit based on insufficient memory or stale configuration metadata left over from a migration. In some cases, orphaned connections from application pools or linked server sessions that are not properly closed can also exhaust the available connection slots faster than expected.

Step-by-Step Resolution Guide

Step 1: Check the Current User Connections Configuration

  • Open SQL Server Management Studio (SSMS) or sqlcmd and run:
  • EXEC sp_configure 'user connections';
  • Review the run_value column — a value of 0 means “unlimited” (dynamically allocated), while any positive number is a hard cap.
  • Note the current limit reported in the Error 5828 message to compare against this output.

Step 2: Reset or Increase the User Connections Limit

  • To allow SQL Server to manage connections dynamically, run:
  • EXEC sp_configure 'show advanced options', 1; RECONFIGURE;
  • EXEC sp_configure 'user connections', 0;
  • RECONFIGURE;
  • If a specific higher limit is required instead of 0, replace it with an appropriate integer (e.g., 500), based on expected concurrent workloads.
  • Restart the SQL Server service via services.msc or Restart-Service MSSQLSERVER in PowerShell (Windows Server 2025/Windows 11) for the change to take effect.

Step 3: Identify and Terminate Orphaned Connections

  • Run sp_who2 or query sys.dm_exec_sessions to identify idle or orphaned sessions consuming connection slots.
  • SELECT session_id, login_name, status, last_request_end_time FROM sys.dm_exec_sessions WHERE is_user_process = 1;
  • Use KILL <session_id>; to manually terminate stale or zombie sessions if the application layer is not releasing them properly.

Step 4: Audit Application Connection Pooling Settings

  • Check connection strings in IIS, .NET apps, or middleware for Max Pool Size settings that may be set unnecessarily high.
  • Ensure connection pooling is enabled (Pooling=True) to reuse connections efficiently instead of opening new ones per request.
  • Adjust Min Pool Size and Max Pool Size values to align with the SQL Server’s actual user connections limit.

Alternative or Verification Steps

  • Verify the fix by monitoring active connections in real time using SELECT COUNT(*) FROM sys.dm_exec_connections; and confirming it stays below the configured threshold during peak load.
  • If Error 5828 persists after reconfiguration, check Windows Server 2025 Event Viewer (Applications and Services Logs > MSSQLSERVER) for memory pressure warnings, as insufficient RAM can also cause SQL Server to silently cap connections regardless of the sp_configure value.

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

Troubleshooting Guide: SQL Server Error 5812 – “You do not have permission to run the RECONFIGURE statement”

Why This Error Happens

This error occurs because the login attempting to execute RECONFIGURE lacks the ALTER SETTINGS server-level permission, which is required alongside sp_configure changes. By default, only members of the sysadmin or serveradmin fixed server roles hold this permission, so standard users or application service accounts are denied. This commonly surfaces when a deployment script, DBA tool, or automated job runs under a low-privilege account during server configuration changes.

Step-by-Step Resolution Guide

Step 1: Verify the Current Login’s Role Membership

  • Open SQL Server Management Studio (SSMS) and connect using an account with sysadmin privileges.
  • Run the following query to check role membership for the problematic login:
  SELECT sp.name, r.name AS role_name
  FROM sys.server_principals sp
  JOIN sys.server_role_members rm ON sp.principal_id = rm.member_principal_id
  JOIN sys.server_principals r ON rm.role_principal_id = r.principal_id
  WHERE sp.name = 'YourLoginName';
  • Confirm whether sysadmin or serveradmin is missing from the results.

Step 2: Grant the ALTER SETTINGS Permission

  • Instead of adding the user to a full admin role, grant only the specific permission needed:
  USE master;
  GRANT ALTER SETTINGS TO [YourLoginName];
  • This follows the principle of least privilege while resolving the RECONFIGURE error.
  • Alternatively, if broader administrative rights are appropriate for this account, add it to the serveradmin role:
  ALTER SERVER ROLE serveradmin ADD MEMBER [YourLoginName];

Step 3: Re-run the Configuration Command

  • Log back in (or reconnect) as the affected user to refresh the session’s security token.
  • Execute the original command sequence again, for example:
  EXEC sp_configure 'show advanced options', 1;
  RECONFIGURE;
  • Check the Messages tab in SSMS for confirmation that the command completed without permission errors.

Step 4: Check for Policy-Based Management Restrictions

  • On Windows Server 2025 environments using Group Policy or SQL Server Policy-Based Management (PBM), confirm no server-level policy is blocking ALTER SETTINGS grants.
  • Navigate to SSMS > Management > Policy Management > Policies and review any policies tagged “Surface Area Configuration.”

Alternative or Verification Steps

  • Verify the fix by logging in as the previously failing account and running EXEC sp_configure 'remote access', 1; RECONFIGURE; — it should complete without Error 5812.
  • If permissions still fail after granting ALTER SETTINGS, check for a Contained Database context or a Deny ALTER SETTINGS rule explicitly set at the login level using SELECT * FROM sys.server_permissions WHERE state = 'D';.

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

Troubleshooting Guide: SQL Server Error 5810 — Invalid Fill Factor Value

Why This Error Happens

Error 5810 occurs when a FILLFACTOR value specified in an index creation or rebuild statement falls outside the valid range of 0 to 100. This typically happens due to a typo, a corrupted or auto-generated deployment script, or a dynamic SQL statement that calculates the fill factor incorrectly (resulting in a negative number or a value exceeding 100). In some cases, this also surfaces when legacy maintenance scripts or third-party tools pass an uninitialized or null variable that defaults to an out-of-range integer.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Script or Query

  • Check SQL Server Management Studio (SSMS) Query Results pane or SQL Server Agent Job History for the exact T-SQL statement that triggered Error 5810.
  • Look specifically for CREATE INDEX, ALTER INDEX, or sp_configure 'fill factor' statements.
  • Run the following to check the current server-wide default:
  EXEC sp_configure 'fill factor';

Step 2: Correct the Fill Factor Value in the Script

  • Open the script in SSMS or Azure Data Studio and locate the WITH (FILLFACTOR = n) clause.
  • Ensure n is an integer between 0 and 100 (inclusive). Common valid examples: 90, 80, 0 (which behaves like 100).
  • Fix dynamic SQL variables that calculate fill factor, ensuring no arithmetic operation can produce a negative or >100 result:
  DECLARE @FillFactor INT = 90;
  IF @FillFactor NOT BETWEEN 0 AND 100
      SET @FillFactor = 90; -- fallback safeguard

Step 3: Reset the Server-Level Default (If Applicable)

  • If the error originates from a server configuration rather than a single script, reset the instance-wide default fill factor using SSMS or PowerShell on Windows Server 2025/Windows 11.
  • Run the following in a query window connected via SSMS:
  EXEC sp_configure 'show advanced options', 1;
  RECONFIGURE;
  EXEC sp_configure 'fill factor', 90;
  RECONFIGURE;
  • Restart the SQL Server service via services.msc or Restart-Service -Name MSSQLSERVER in an elevated PowerShell session for changes to take full effect.

Step 4: Validate Index Maintenance Jobs

  • Review any SQL Server Agent jobs or Ola Hallengren maintenance solution scripts that rebuild indexes with custom fill factor logic.
  • Correct any @FillFactor parameter passed into stored procedures like IndexOptimize to ensure it stays within the 0–100 bound.

Alternative or Verification Steps

  • Re-run the corrected CREATE INDEX or ALTER INDEX statement and confirm it completes without Error 5810; check sys.indexes to verify the fill_factor column reflects the intended value.
  • If the issue persists in automated jobs, add input validation/sanitization logic in the calling application or ETL tool before the value reaches SQL Server, preventing out-of-range values from ever being submitted.

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

Troubleshooting Guide: SQL Server Error 5808 – “Ad Hoc Update to System Catalogs Is Not Supported”

Why This Error Happens

This error occurs when an application, script, or administrator attempts to directly modify SQL Server’s system catalog tables (such as sys.sysobjects, sys.syscolumns, or other internal metadata tables) using direct INSERT, UPDATE, or DELETE statements. Microsoft SQL Server 2025 deliberately blocks this behavior because direct manipulation of system catalogs can corrupt database metadata, break internal consistency checks, and lead to unrecoverable database states. This typically happens when legacy scripts written for older SQL Server versions (pre-2005) are run on modern instances, or when the allow updates configuration option is mistakenly referenced in automation scripts.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Script or Query

  • Review the SQL Server error log or Extended Events session to capture the exact T-SQL statement that triggered Error 5808.
  • Check if the query directly references system tables like sys.sysdatabases, sys.sysobjects, or sys.syscolumns.
  • Command to check recent errors: EXEC sp_readerrorlog 0, 1, 'Error: 5808';

Step 2: Replace Direct Catalog Edits with Supported DDL/Catalog Views

  • Rewrite any direct UPDATE/INSERT/DELETE statements against system tables using supported system stored procedures (e.g., sp_rename, sp_configure, ALTER DATABASE, ALTER TABLE).
  • Use read-only catalog views (sys.tables, sys.columns, sys.objects) for querying metadata instead of legacy system tables.
  • If metadata correction is required, use DBCC CHECKDB with appropriate repair options rather than manual edits.

Step 3: Verify the allow updates Configuration Is Disabled (Default in 2025)

  • Open SQL Server Management Studio (SSMS) or a query window and run:
  • EXEC sp_configure 'allow updates', 0;
  • RECONFIGURE WITH OVERRIDE;
  • Confirm this value is set to 0, as SQL Server 2025 ignores this setting for catalog protection by design, but legacy scripts may still attempt to toggle it.
  • Restart the SQL Server service via services.msc or Get-Service MSSQLSERVER | Restart-Service in PowerShell if changes were made.

Step 4: Audit and Update Legacy Automation Scripts

  • Search deployment scripts, SSIS packages, and scheduled jobs (via SQL Server Agent) for references to system table names.
  • Update third-party tools or custom DBA scripts to use DMVs (sys.dm_*) and catalog views instead of direct table access.
  • Document and version-control the corrected scripts to prevent recurrence.

Alternative or Verification Steps

  • To verify the fix, re-run the original script or job in a test environment and confirm it completes without raising Error 5808 in the SQL Server Error Log (Management > SQL Server Logs in SSMS).
  • If the error persists and originates from a third-party application, contact the vendor for an updated version compatible with SQL Server 2025, as direct catalog access was deprecated in favor of catalog views starting with SQL Server 2005 and is fully enforced in 2025.

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

Troubleshooting Guide: SQL Server Error 5807 – Recovery Interval Exceeds Recommended Threshold

Why This Error Happens

This error occurs because the recovery interval (min) server configuration option has been set to a value that exceeds Microsoft’s recommended safe threshold, typically triggered when an administrator attempts to manually extend checkpoint intervals to reduce I/O overhead. SQL Server 2025 enforces this soft limit by default because excessively long recovery intervals can dramatically increase database startup and crash recovery time, risking extended downtime. The engine blocks the change via standard RECONFIGURE as a safety guardrail, requiring explicit override intent from the administrator.

Step-by-Step Resolution Guide

Step 1: Verify the Current Recovery Interval Setting

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio and connect to the target instance.
  • Run the following query to check current configuration values:
  EXEC sp_configure 'recovery interval';
  • Confirm whether the config_value exceeds the recommended range (values above 60 minutes typically trigger this warning).

Step 2: Decide Between Reverting or Overriding the Setting

  • If the high value was unintentional, reset it to a safer default (0 for automatic management, or a value under 60):
  EXEC sp_configure 'show advanced options', 1;
  RECONFIGURE;
  EXEC sp_configure 'recovery interval', 0;
  RECONFIGURE;
  • If the extended interval is intentional (e.g., for a specific workload reducing checkpoint frequency), proceed to Step 3 to force the configuration.

Step 3: Apply the Override Using RECONFIGURE WITH OVERRIDE

  • Execute the following T-SQL block to force the setting despite the warning:
  EXEC sp_configure 'show advanced options', 1;
  RECONFIGURE;
  EXEC sp_configure 'recovery interval', <desired_value>;
  RECONFIGURE WITH OVERRIDE;
  • Replace <desired_value> with your intended minute value (e.g., 90 or 120).
  • Restart the SQL Server service via Windows Services (services.msc) or PowerShell to ensure the change is fully applied:
  Restart-Service -Name 'MSSQLSERVER' -Force

Step 4: Review SQL Server Error Logs for Confirmation

  • Navigate to the default log path: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Search for configuration change entries confirming the new recovery interval value was accepted without further errors.

Alternative or Verification Steps

  • Run EXEC sp_configure 'recovery interval'; again post-restart and confirm the run_value column matches your intended setting, indicating the override was successfully applied.
  • If performance issues arise from extended recovery intervals (e.g., slow crash recovery during testing), consider reverting to the default value of 0, which allows SQL Server to auto-manage checkpoint frequency based on workload.

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

Troubleshooting Guide: SQL Server Error 5805 – “Too Few Locks Specified”

Why This Error Happens

This error occurs when the locks configuration option in SQL Server has been manually set to a value below the minimum threshold required for the engine to start and operate safely. SQL Server 2025 requires a baseline number of lock structures to manage concurrency, and setting this value too low (often during an attempt to manually tune memory) prevents the Lock Manager from initializing. This is typically caused by a misconfigured sp_configure 'locks' value or a legacy startup parameter carried over from a server migration or restore.

Step-by-Step Resolution Guide

Step 1: Verify the Current Locks Configuration

  • Open SQL Server Management Studio (SSMS) or connect via sqlcmd using the Dedicated Administrator Connection (DAC) if the instance won’t start normally.
  • Run the following query to check the current setting: EXEC sp_configure 'locks';
  • Note the config_value and run_value columns; a non-zero value below the system minimum (typically 5000) is the likely culprit.

Step 2: Reset the Locks Value to Dynamic (Default)

  • Execute the following T-SQL commands to restore dynamic lock management, which is the recommended setting for SQL Server 2025:
  • EXEC sp_configure 'show advanced options', 1; RECONFIGURE;
  • EXEC sp_configure 'locks', 0; RECONFIGURE;
  • Setting the value to 0 allows SQL Server to dynamically allocate and de-allocate lock memory as needed, preventing manual threshold errors.

Step 3: Start the Instance Using Minimal Configuration (If Service Won’t Start)

  • If the SQL Server service fails to start due to this error, open the Services app (services.msc) on Windows Server 2025/Windows 11.
  • Locate the SQL Server service, right-click, and navigate to Properties.
  • Temporarily add the startup parameter -f (minimal configuration) in the Startup Parameters tab to force the engine to bypass the invalid locks setting.
  • Start the service, apply the fix detailed in Step 2, remove the -f flag, and restart the service normally.

Step 4: Check for Registry or Startup Script Overrides

  • Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQLServer\Parameters in the Windows Registry.
  • Inspect for any legacy -T trace flags or startup scripts that might be re-applying an old locks value on every restart.
  • Remove or correct any deprecated parameters found in this key.

Alternative or Verification Steps

  • Verify the Fix: Restart the SQL Server service via services.msc or net start MSSQLSERVER and confirm the instance comes online without Error 5805 appearing in the SQL Server Error Log (located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG).
  • Alternative Solution: If the configuration continues to revert, restore the master database from a known-good backup taken prior to the configuration change, as a corrupted master database can sometimes cause configuration values to stick incorrectly.

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

Troubleshooting Guide: SQL Server Error 5804 — Character Set / Configuration Mismatch

Why This Error Happens

Error 5804 typically occurs when SQL Server 2025 detects a mismatch between the character set configuration stored in the instance’s registry settings and the actual collation or locale configured during setup. This often happens after an incomplete installation, a corrupted master database resource file, or when the server’s regional/locale settings on Windows Server 2025 or Windows 11 were changed after SQL Server was installed. In some cases, this is also triggered by a damaged Resource.ide or Resource.mdf file not matching the installed code page.

Step-by-Step Resolution Guide

Step 1: Verify the Server Collation and Locale Settings

  • Open SQL Server Management Studio (SSMS) and run: SELECT SERVERPROPERTY('Collation');
  • Compare the returned collation with the OS locale under Control Panel > Region > Administrative > Language for non-Unicode programs.
  • Note any mismatch between the SQL Server collation code page and the Windows system locale.

Step 2: Rebuild the Master Database with Correct Collation

  • Open Command Prompt as Administrator and navigate to the SQL Server installation binn directory, typically: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Binn
  • Run the setup rebuild command:
  setup.exe /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=MSSQLSERVER /SQLSYSADMINACCOUNTS=BUILTIN\Administrators /SAPWD=<StrongPassword> /SQLCOLLATION=SQL_Latin1_General_CP1_CI_AS
  • Replace SQL_Latin1_General_CP1_CI_AS with the collation matching your application’s required character set.

Step 3: Check and Restore the Resource Database Files

  • Navigate to: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Binn\Templates
  • Confirm Resource.mdf and Resource.ldf exist and are not zero-byte or corrupted.
  • If corrupted, restore these files from the original installation media or a verified backup, then restart the SQL Server (MSSQLSERVER) service via services.msc.

Step 4: Restart SQL Server Services and Validate Configuration

  • Open services.msc on Windows Server 2025/Windows 11.
  • Restart SQL Server (MSSQLSERVER) and SQL Server Agent services.
  • Re-run: SELECT SERVERPROPERTY('Collation'); to confirm the setting now matches the expected character set.

Alternative or Verification Steps

  • Run DBCC CHECKDB('master') to confirm no further corruption exists after the rebuild, and test data retrieval queries that previously failed due to Error 5804.
  • If the issue persists, perform a full uninstall/reinstall of the SQL Server 2025 instance, explicitly specifying the correct /SQLCOLLATION parameter during setup to prevent recurrence.

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

Troubleshooting Guide: SQL Server Error 5803 — “Unknown Configuration (id = %d) Encountered in sys.configurations”

Why This Error Happens

This error typically occurs when the sys.configurations system catalog becomes out of sync with the internal configuration metadata table maintained by the SQL Server engine, often due to an incomplete upgrade or patch installation on SQL Server 2025. It can also arise from a corrupted master database, where configuration IDs referenced internally no longer match the expected schema definitions. In some cases, manual edits to configuration values via unsupported trace flags or direct registry manipulation on Windows Server 2025 can introduce orphaned or unrecognized configuration IDs.

Step-by-Step Resolution Guide

Step 1: Verify SQL Server Build and Patch Level

  • Open SQL Server Management Studio (SSMS) and run SELECT @@VERSION; to confirm the current build number.
  • Compare this against the latest Cumulative Update (CU) for SQL Server 2025 listed on the Microsoft Update Catalog.
  • If the instance is mid-upgrade or on a hotfix build, apply the latest CU package to ensure sys.configurations metadata is fully reconciled.

Step 2: Rebuild the Configuration Metadata Cache

  • Stop the SQL Server service via services.msc or run NET STOP MSSQLSERVER from an elevated Command Prompt.
  • Restart the instance using the -f (minimal configuration) startup parameter to force SQL Server to rebuild internal configuration structures.
  • Once started, run RECONFIGURE WITH OVERRIDE; followed by EXEC sp_configure; to confirm all configuration IDs now resolve correctly.

Step 3: Check for master Database Corruption

  • Run DBCC CHECKDB('master') WITH NO_INFOMSGS, ALL_ERRORMSGS; to scan for corruption in system tables.
  • If corruption is detected, restore the master database from a known-good backup using RESTORE DATABASE master FROM DISK = 'C:\Backup\master.bak' WITH REPLACE; in single-user mode (sqlservr.exe -m).
  • If no backup exists, rebuild system databases using the SQL Server 2025 installation media via Setup.exe /ACTION=REBUILDDATABASE.

Step 4: Clear Orphaned Trace Flags or Custom Configuration Entries

  • Review the SQL Server Error Log (located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for any custom startup trace flags tied to the unknown configuration ID.
  • Remove unsupported trace flags from SQL Server Configuration Manager under SQL Server Services > Startup Parameters.
  • Restart the SQL Server service normally and re-check sys.configurations for consistency.

Alternative or Verification Steps

  • Run SELECT * FROM sys.configurations WHERE configuration_id = <id>; using the specific ID from the error message to confirm it now returns a valid, recognized row.
  • If the error persists after patching and a master database rebuild, open a Microsoft Support (CSS) case and provide the full ERRORLOG along with SELECT * FROM sys.dm_server_registry; output for deeper diagnostic analysis.

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

Why This Error Happens

Error 5703 is technically an informational message rather than a critical failure, triggered when the SQL Server Database Engine switches the session or server-wide default language setting. This typically occurs due to a mismatch between the client application’s regional settings and the server’s default language configuration, or because a login’s default language property differs from master.sys.syslanguages. While not inherently destructive, frequent triggering of this message in high-transaction environments can indicate configuration drift that leads to unnecessary plan recompilations.

Step-by-Step Resolution Guide

Step 1: Verify the Current Server Default Language

  • Open SQL Server Management Studio (SSMS) and connect to the Windows Server 2025 instance.
  • Run the following T-SQL query to check the current configuration:
  EXEC sp_configure 'default language';
  • Note the run_value; if it does not match your organizational standard (e.g., 0 for us_english), proceed to Step 2.

Step 2: Align Login-Specific Language Settings

  • Navigate to Security > Logins in SSMS Object Explorer.
  • Right-click the specific login reporting the error and select Properties.
  • Under the General tab, check the Default language dropdown.
  • Ensure this matches the language pack installed on the Windows Server 2025 OS layer (Control Panel > Region > Administrative > Language for non-Unicode programs).

Step 3: Update Server-Wide Configuration via T-SQL

  • If the issue stems from a server-wide misconfiguration rather than a single user, execute the following to reset the default language ID (0 = us_english):
  EXEC sp_configure 'show advanced options', 1;
  RECONFIGURE;
  EXEC sp_configure 'default language', 0;
  RECONFIGURE WITH OVERRIDE;
  • Restart the SQL Server (MSSQLSERVER) service via the Services console (services.msc) or SQL Server Configuration Manager to apply the engine-level changes.

Step 4: Check for Regional Settings Conflicts in Windows 11/Server 2025

  • Open Settings > Time & Language > Language & Region.
  • Verify that the “Windows display language” does not conflict with the SQL Server collation settings established during installation.
  • If a conflict exists, you may need to reinstall the specific Language Pack for SQL Server 2025 to ensure dictionary and error message files align.

Alternative or Verification Steps

  • Verify the Fix: Query the SQL Server Error Log via EXEC sp_readerrorlog; after a new connection attempt. If the environment is stable, the “Changed language setting” message should cease appearing for standard connections, or appear only once per distinct session as expected (not continuously).
  • Alternative Solution: If the message persists due to a specific application (like a reporting tool) forcing a language change via connection string, update the application’s connection string to explicitly exclude the Language parameter, forcing it to inherit the server default instead.

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

Why This Error Happens

Error 5702 typically occurs when the SQL Server service account lacks the necessary permissions to initialize a worker process, or when a startup dependency—such as a corrupted system database (master, model, or tempdb)—fails to load correctly. This can also be triggered by resource exhaustion (insufficient memory or handles) on the host, or a conflict with another process holding a lock on required SQL Server files during startup. In clustered or Always On environments, this error can additionally stem from a failed handshake between the SQL Server process and the Windows Server 2025 Cluster Service.

Step-by-Step Resolution Guide

Step 1: Verify Service Account Permissions

  • Open Services.msc and locate the SQL Server (MSSQLSERVER or named instance) service.
  • Confirm the “Log On As” account has Log on as a service rights under Local Security Policy (secpol.msc > Local Policies > User Rights Assignment).
  • Ensure the account has full control over the SQL Server data directory, typically: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA.

Step 2: Check for Corrupted System Databases

  • Start SQL Server in minimal configuration mode by running: sqlservr.exe -f from an elevated Command Prompt.
  • Once started, run DBCC CHECKDB('master') and DBCC CHECKDB('tempdb') to check for corruption.
  • If corruption is found, restore the affected system database from a known good backup or rebuild system databases using the Setup.exe /ACTION=REBUILDDATABASE switch.

Step 3: Review Windows Event Viewer and SQL Error Logs

  • Open Event Viewer > Windows Logs > Application, and filter for Source “MSSQLSERVER”.
  • Cross-reference the timestamp of Error 5702 with entries in the SQL Server ERRORLOG file, located at: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Look for preceding errors related to memory allocation, file I/O, or access denied messages that indicate the true root cause.

Step 4: Free Up System Resources

  • Check Task Manager or Resource Monitor for excessive memory or handle usage by other processes.
  • Increase the Virtual Memory / Page File size via System Properties > Advanced > Performance Settings if physical RAM is constrained.
  • Restart the server if a memory leak from another application is suspected, then attempt to restart the SQL Server service.

Step 5: Reinstall or Repair the SQL Server Instance

  • If the above steps fail, run the SQL Server 2025 setup media and choose the Repair option for the affected instance.
  • Follow the prompts to repair core binaries and instance configuration without affecting existing databases.

Alternative or Verification Steps

  • After applying fixes, restart the SQL Server service and confirm successful startup by checking that the ERRORLOG shows “SQL Server is now ready for client connections” with no further 5702 entries.
  • If the error persists, consider creating a brand new named instance as a temporary workaround to isolate whether the issue is instance-specific or environment-wide.

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

Why This Error Happens

Error 5701 is not a true failure state but an informational severity-10 message that SQL Server raises automatically whenever a USE <database> statement executes successfully, confirming the session’s database context has switched. It frequently gets flagged as an “error” in log monitoring tools or SSMS output panes because it is logged to the SQL Server error log with the same formatting as real errors. In most cases this message appears due to login scripts, ORM frameworks, or connection pooling routines that explicitly issue a USE command on every connection, or because a default database setting differs from what the application expects.

Step-by-Step Resolution Guide

Step 1: Confirm the Message Is Informational, Not a Failure

  • Open SQL Server Management Studio (SSMS) and connect to the instance running on Windows Server 2025 / Windows 11.
  • Check the Messages tab after running a query — severity level 10 messages (like 5701) do not halt execution or indicate corruption.
  • Cross-reference the SQL Server error log via EXEC sp_readerrorlog; to confirm no accompanying severity 16+ errors exist nearby.

Step 2: Suppress Unwanted Context-Switch Logging

  • Locate the connection string or application config (e.g., web.config, appsettings.json, or ODBC/DSN settings) issuing explicit USE statements on every connect.
  • Set the correct Default Database for the login directly instead of calling USE repeatedly:
  • Run: ALTER LOGIN [YourLoginName] WITH DEFAULT_DATABASE = YourTargetDB;
  • If using SSMS scripts or stored procedures, remove redundant USE statements once the default database context is properly set at the login level.

Step 3: Adjust Error Log Verbosity (If Message Clutter Is the Concern)

  • Open SQL Server Configuration Manager on Windows Server 2025.
  • Navigate to the instance properties under SQL Server Services, right-click the instance, and select Properties > Startup Parameters.
  • Avoid using trace flag -1 (verbose logging); instead, confirm Trace Flag 3226 is enabled to suppress successful backup messages and reduce informational log noise:
  • Add -T3226 under Startup Parameters and restart the SQL Server service.

Step 4: Restart the SQL Server Service to Apply Changes

  • Open Services.msc on Windows Server 2025 / Windows 11.
  • Locate SQL Server (MSSQLSERVER) or your named instance, right-click, and select Restart.
  • Confirm the service returns to a Running state before reconnecting via SSMS.

Alternative or Verification Steps

  • Run SELECT DB_NAME(); immediately after connecting to confirm the session context matches the expected database without triggering repeated 5701 messages.
  • If the message persists in monitoring/alerting tools, configure your monitoring software (e.g., SolarWinds, SCOM) to filter Event ID 5701 as informational rather than critical, since this is expected SQL Server behavior and not a defect.

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

Troubleshooting Guide: SQL Server Error 5605 — SA Account Password Regeneration/Disable Failure

Why This Error Happens

Error 5605 occurs when SQL Server 2025 cannot complete the SA account lockdown process triggered by the -K startup parameter combined with trace flag -T1617. This typically happens because the SQL Server service account lacks sufficient permissions on the system catalog or the master database’s security tables are locked by another session during startup. It can also occur if the master database files are marked read-only, corrupted, or if a failed previous upgrade left the sys.server_principals metadata in an inconsistent state.

Step-by-Step Resolution Guide

Step 1: Verify Startup Parameters and Trace Flag Syntax

  • Open SQL Server Configuration Manager on Windows Server 2025 / Windows 11.
  • Navigate to SQL Server Services > right-click your instance > Properties > Startup Parameters.
  • Confirm the parameter is entered exactly as -K (capital K) and trace flag as -T1617, with no trailing spaces or duplicate entries.
  • Remove any conflicting legacy flags such as -T4616 or -T902 that may interfere with security principal initialization.

Step 2: Check File System and Database Permissions

  • Ensure the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control on the data directory, typically:
    C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\
  • Confirm master.mdf and mastlog.ldf are not set to Read-only via file properties.
  • Run the following command in an elevated PowerShell session to reset ACLs if needed:
  icacls "C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\master.mdf" /grant "NT SERVICE\MSSQLSERVER:(F)"

Step 3: Start SQL Server in Single-User Mode and Rebuild Security Metadata

  • Stop the SQL Server service via services.msc or net stop MSSQLSERVER.
  • Restart manually from an elevated Command Prompt using:
  sqlservr.exe -m -T1617 -K
  • Connect via sqlcmd -S . -E and manually inspect the SA principal:
  SELECT name, is_disabled FROM sys.server_principals WHERE name = 'sa';
  • If the row is missing or corrupted, run DBCC CHECKDB('master') WITH NO_INFOMSGS, ALL_ERRORMSGS to detect catalog corruption.

Step 4: Clear Cached Credential Locks and Restart Service Normally

  • Exit single-user mode and stop the instance.
  • Delete any stale lock files in the Log folder (e.g., ERRORLOG.1, ERRORLOG.2) that may reference held SA locks from a previous failed shutdown.
  • Restart the SQL Server service normally through SQL Server Configuration Manager to reapply the -K and -T1617 flags cleanly.

Step 5: Reapply SA Lockdown Policy via T-SQL Fallback

  • If the startup flags still fail to apply, manually enforce the policy using T-SQL as a fallback:
  ALTER LOGIN sa DISABLE;
  ALTER LOGIN sa WITH PASSWORD = 'ComplexRandomPassword!2025' MUST_CHANGE;
  • Confirm this change is logged without Error 5605 reappearing in the SQL Server Error Log.

Alternative or Verification Steps

  • Verify the fix by querying SELECT is_disabled FROM sys.server_principals WHERE name = 'sa'; — a result of 1 confirms the account is successfully disabled.
  • If the error persists, consider restoring master.mdf from a known-good backup taken prior to the upgrade, then reapply the -K and -T1617 startup flags on a clean instance.

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

Why This Error Happens

Error 5604 is actually an informational/benign message that appears in the SQL Server Error Log, typically triggered during setup or an unattended installation when SQL Server detects Mixed Mode Authentication is enabled but no explicit, complex password was supplied for the sa account. Because the Setup wizard or command-line installer requires a strong password to satisfy Windows Server 2025 security policies, the engine automatically regenerates a random, complex password for the sa login to prevent the installation from failing outright. While the message confirms the regeneration succeeded, it effectively locks the sa account behind an unknown password string, which can block administrators expecting to log in with a default or specific credential.

Step-by-Step Resolution Guide

Step 1: Verify the Current Authentication Mode

  • Open SQL Server Management Studio (SSMS) and connect using Windows Authentication (since you don’t know the auto-generated sa password).
  • Right-click the server instance in Object Explorer, select Properties, then navigate to the Security page to confirm “SQL Server and Windows Authentication mode” is selected.

Step 2: Manually Reset the SA Password via T-SQL

  • In a New Query window (connected via Windows Auth), run the following to overwrite the randomly generated password:
  • ALTER LOGIN sa WITH PASSWORD = 'YourNew$trongP@ssw0rd123';
  • Ensure the new password meets Windows Server 2025 complexity policies (minimum 8 characters, uppercase, lowercase, numbers, and symbols) to avoid triggering the regeneration event again on restart.

Step 3: Enable and Unlock the SA Login

  • Confirm the login is not disabled by running:
  • ALTER LOGIN sa ENABLE;
  • Check the login properties in SSMS under Security > Logins > sa > Status to ensure “Login” is set to Enabled and “Permission to connect to database engine” is set to Grant.

Step 4: Restart the SQL Server Service

  • Open Services.msc on Windows Server 2025 or Windows 11.
  • Locate SQL Server (MSSQLSERVER) or the named instance, right-click, and select Restart to ensure the Authentication Mode and password changes are fully applied to the engine.

Alternative or Verification Steps

  • Verification: Attempt to log in via SSMS using SQL Server Authentication with the username sa and the new password you set in Step 2. A successful connection confirms the fix.
  • Alternative: If the sa login remains inaccessible, start the SQL Server instance in Single-User Mode (using the -m startup parameter via SQL Server Configuration Manager) to reset the password without interference from other active sessions.

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

Troubleshooting Guide: Error 5603 – SA Password Could Not Be Force Regenerated (-K Startup Option)

Why This Error Happens

This error occurs when SQL Server’s -K startup option attempts to regenerate the SA account password but fails due to insufficient privileges on the service account, a locked or corrupted master database, or a conflict in the Windows Registry permissions tied to SQL Server’s installation path. It can also happen if the SQL Server service account lacks the necessary rights to write to the system catalog during startup, or if the master database files are in a read-only state. Additionally, Group Policy restrictions on Windows Server 2025 / Windows 11 may block the forced credential rewrite operation.

Step-by-Step Resolution Guide

Step 1: Verify Service Account Permissions

  • Open Services.msc and locate the SQL Server (MSSQLSERVER) service.
  • Right-click → Properties → Log On tab, and confirm the account has “Log on as a service” rights.
  • Ensure the account has full control over C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA.
  • Run icacls "C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA" /grant "NT SERVICE\MSSQLSERVER":(OI)(CI)F in an elevated Command Prompt.

Step 2: Check and Repair Master Database File Permissions

  • Navigate to the DATA folder and confirm master.mdf and mastlog.ldf are not set to read-only.
  • Right-click each file → Properties → uncheck “Read-only” if selected.
  • Run sqlservr.exe -c -m -T3608 from an elevated command prompt to start SQL Server in single-user, minimal configuration mode for manual diagnostics.

Step 3: Remove and Reapply the -K Startup Parameter Correctly

  • Open SQL Server Configuration Manager → SQL Server Services → right-click instance → Properties → Startup Parameters tab.
  • Remove the existing -K parameter entirely and restart the service once to confirm normal startup.
  • Re-add -K only when prepared to immediately supply a new SA password via -K"NewStrongPassword!123" and restart the service again.

Step 4: Validate Group Policy and Registry Access

  • Open gpedit.msc and confirm no local security policies restrict password changes for system accounts.
  • Check registry path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQLServer for correct permission inheritance.
  • Restart the SQL Server service as Administrator after confirming registry ACLs are intact.

Alternative or Verification Steps

  • After restarting, check the SQL Server Error Log (ERRORLOG file in the DATA folder) to confirm the SA password reset completed without Error 5603 reappearing.
  • If the issue persists, use sqlcmd -S localhost -U sa -P "NewStrongPassword!123" to manually test SA login, or fallback to rebuilding system databases via setup.exe /ACTION=REBUILDDATABASE if corruption is suspected.

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

Troubleshooting Guide: SQL Server Error 5602 — Service Master Key Regeneration

Why This Error Happens

Error 5602 is actually an informational success message, not a failure—it is logged when the Service Master Key (SMK) has been successfully regenerated, typically after a restore, migration, or manual ALTER SERVICE MASTER KEY REGENERATE operation. However, this message often causes confusion or downstream issues because regenerating the SMK re-encrypts all dependent keys (database master keys, linked server credentials, certificates), and if any of those dependent objects fail to re-encrypt properly, subsequent errors can surface that are mistakenly attributed to Error 5602 itself. On Windows Server 2025 / Windows 11 hosts, this is frequently triggered by SQL Server service account changes, Windows credential store resets, or automated DR/failover scripts that force a key regeneration without validating downstream encryption dependencies.

Step-by-Step Resolution Guide

Step 1: Confirm the Context of the Regeneration Event

  • Check the SQL Server Error Log (Management > SQL Server Logs in SSMS, or C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) to confirm Error 5602 appears alongside a successful completion message.
  • Correlate the timestamp with recent administrative actions: service account password changes, ALTER SERVICE MASTER KEY commands, or a DR failover script execution.
  • Run SELECT * FROM sys.messages WHERE message_id = 5602; in SSMS to confirm this is logged as an informational (severity 10) event, not a true error.

Step 2: Validate Dependent Encryption Hierarchy

  • Run OPEN MASTER KEY DECRYPTION BY PASSWORD = '<YourDBMK_Password>'; on each user database to confirm the Database Master Key (DMK) still decrypts correctly against the new SMK.
  • If decryption fails, re-encrypt the DMK using:
  ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY SERVICE MASTER KEY;
  • Check linked servers and credentials via sys.linked_logins and sys.credentials; test connectivity with EXEC sp_testlinkedserver 'LinkedServerName';.

Step 3: Back Up the New Service Master Key Immediately

  • Navigate to a secure backup location (e.g., D:\SQLBackups\Keys\) and run:
  BACKUP SERVICE MASTER KEY TO FILE = 'D:\SQLBackups\Keys\SMK_Backup.key'
  ENCRYPTION BY PASSWORD = '<StrongBackupPassword>';
  • Store this backup file and password in a secure, offline location (e.g., a password vault or HSM), since losing it post-regeneration can permanently lock encrypted data if disaster recovery is needed later.
  • Update any documentation or automation scripts (Ansible/PowerShell DSC) that reference the old SMK backup file path.

Step 4: Restart SQL Server Services to Finalize State

  • Open Services.msc on Windows Server 2025 / Windows 11 and restart the SQL Server (MSSQLSERVER) service (or named instance equivalent).
  • Alternatively, run from an elevated PowerShell prompt:
  Restart-Service -Name 'MSSQLSERVER' -Force
  • Confirm the SQL Server Agent and any dependent services (SSRS, SSIS) also restart cleanly without throwing encryption-related errors.

Alternative or Verification Steps

  • Verify success by querying SELECT crypt_type_desc FROM sys.key_encryptions WHERE crypt_type = 'SMKS'; to confirm all service master key encryptions report a healthy state.
  • If downstream errors persist (e.g., linked servers failing or certificates unreadable), restore the previous SMK backup using RESTORE SERVICE MASTER KEY FROM FILE = '<path>' DECRYPTION BY PASSWORD = '<password>' as a rollback, then re-attempt regeneration during a maintenance window with all dependent services stopped.

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

Why This Error Happens

Error 5601 occurs when SQL Server 2025 attempts to force-regenerate the Service Master Key (SMK) using the -F startup parameter but cannot complete the operation. This typically happens because the SQL Server service account lacks sufficient permissions on the Windows DPAPI (Data Protection API) user profile, the registry key used to store the encrypted SMK is corrupted or locked, or an underlying I/O error prevents SQL Server from writing the newly generated key back to the master database. In most cases, this is tied to a broken Windows user profile for the service account or a permissions mismatch introduced after an OS upgrade to Windows Server 2025 / Windows 11.

Step-by-Step Resolution Guide

Step 1: Verify Service Account Permissions

  • Open Services.msc and confirm the account running the SQL Server (MSSQLSERVER) service.
  • Ensure this account has Full Control on C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Binn.
  • Check that the account has a valid, loaded Windows user profile under C:\Users\<ServiceAccount>; a missing or corrupted profile commonly blocks DPAPI operations needed for SMK regeneration.

Step 2: Check and Repair the Windows User Profile

  • Run whoami /user while logged in as the service account (via a scheduled task or runas) to confirm the SID resolves correctly.
  • If the profile is corrupted, delete the cached profile via System Properties > Advanced > User Profiles > Settings, then restart the SQL Server service to force Windows to rebuild it.
  • Re-run SQL Server with the -F flag only after confirming the profile loads without errors in the Windows Event Viewer (Application log).

Step 3: Start SQL Server in Single-User/Minimal Mode with -F

  • Stop the SQL Server service completely via SQL Server Configuration Manager.
  • Start SQL Server manually from an elevated Command Prompt:
  sqlservr.exe -c -m -F
  • Watch the console output for the specific sub-error number referenced in the %ld placeholder — this number (e.g., Windows error 5 = Access Denied, or 1359 = Internal Error) determines whether the issue is permissions-based or disk/registry corruption.

Step 4: Validate Registry and File System Integrity

  • Open regedit and confirm the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQLServer is accessible and not flagged as read-only or orphaned.
  • Run chkdsk C: /f (schedule on next reboot if needed) to rule out file system corruption affecting the master.mdf/mastlog.ldf files.
  • Confirm there is no Group Policy or AppLocker restriction blocking DPAPI calls for the service account.

Step 5: Restart SQL Server Normally

  • Remove the -F startup parameter from SQL Server Configuration Manager once the key has been successfully regenerated.
  • Restart the SQL Server service normally and confirm it reaches a Running state without re-triggering Error 5601.

Alternative or Verification Steps

  • Run SELECT * FROM sys.symmetric_keys WHERE name = '##MS_ServiceMasterKey##'; in SSMS to confirm the SMK timestamp has updated, indicating successful regeneration.
  • If the issue persists, restore the Service Master Key from a known good backup using RESTORE SERVICE MASTER KEY FROM FILE = '<path>' DECRYPTION BY PASSWORD = '<password>' instead of forcing a regeneration.

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

Troubleshooting Guide: Error 5600 — Cross Database Chaining Option Cannot Be Set

Why This Error Happens

Error 5600 occurs when the SQL Server login attempting to change the DB_CHAINING database option lacks the required ALTER ANY DATABASE or sysadmin level permissions. This error can also surface if the target database is a system database (like master, model, or tempdb) where cross-database chaining modifications are restricted, or if the database is currently in a state (such as read-only, single-user, or offline) that prevents metadata changes. Additionally, if Windows Server 2025 Group Policy or SQL Server’s policy-based management has locked down server-level configuration options, the ALTER DATABASE statement will be rejected.

Step-by-Step Resolution Guide

Step 1: Verify Current User Permissions

  • Open SQL Server Management Studio (SSMS) and connect using an account with known sysadmin privileges.
  • Run the following query to check your current permission level:
  SELECT IS_SRVROLEMEMBER('sysadmin');
  • A return value of 1 confirms sysadmin rights; 0 means you need to escalate privileges or use a different login.

Step 2: Enable Cross-Database Ownership Chaining Correctly

  • Ensure you are not trying to apply this setting to a system database unless absolutely necessary.
  • Execute the command using a sysadmin login, specifying the exact database name:
  ALTER DATABASE [YourDatabaseName] SET DB_CHAINING ON;
  • If this fails, check whether the server-wide chaining policy is disabled via sp_configure:
  EXEC sp_configure 'cross db ownership chaining', 1;
  RECONFIGURE;

Step 3: Check Database State and Connection Mode

  • Confirm the database is not in SINGLE_USER mode while other connections are active, as this can block ALTER DATABASE commands.
  • Run this query to check the current state:
  SELECT name, state_desc, user_access_desc FROM sys.databases WHERE name = 'YourDatabaseName';
  • If the state shows RESTRICTED_USER or SINGLE_USER unexpectedly, switch it back using:
  ALTER DATABASE [YourDatabaseName] SET MULTI_USER;

Step 4: Review Windows Server 2025 Security Policies

  • Open the Local Security Policy editor (secpol.msc) and verify that the SQL Server service account has not been restricted under “Deny log on locally” or similar policies.
  • Check if Windows Defender Application Control (WDAC) or Group Policy Objects (GPOs) are blocking SQL Server service processes from modifying registry-based configuration caches.
  • Restart the SQL Server service via Services.msc after any policy adjustments to apply changes cleanly.

Alternative or Verification Steps

  • To verify the fix, re-run SELECT is_db_chaining_on FROM sys.databases WHERE name = 'YourDatabaseName'; — a return value of 1 confirms the setting was applied successfully.
  • If the issue persists, use the sp_dboption legacy stored procedure (if running in compatibility mode) as an alternative method to toggle the setting, or restart the SQL Server instance entirely to clear any cached permission tokens.

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

Troubleshooting Guide: SQL Server Error 5599 – “.ContainerId is disabled”

Why This Error Happens

Error 5599 typically occurs when SQL Server 2025’s containerized database engine references a Container ID that has been disabled, deregistered, or orphaned within the host’s container management layer. This commonly happens after a failed container orchestration update, a corrupted container metadata entry in the msdb system database, or when Windows Server 2025’s Host Compute Service (HCS) loses synchronization with SQL Server’s container registry. In some cases, this also surfaces when a security policy or Group Policy Object (GPO) disables container isolation features required by SQL Server’s containerized workloads.

Step-by-Step Resolution Guide

Step 1: Verify Container Service Status

  • Open PowerShell as Administrator and run Get-Service -Name "com.docker.service" or Get-Service -Name "hcs*" to confirm the Host Compute Service is running.
  • If the service is stopped, restart it using Start-Service -Name "hcs".
  • Check Event Viewer under Applications and Services Logs > Microsoft > Windows > Hyper-V-Compute for related container errors.

Step 2: Re-Enable the Container ID in SQL Server Configuration

  • Launch SQL Server Configuration Manager and navigate to SQL Server Services.
  • Right-click the affected SQL Server instance and select Properties > Container Settings.
  • Locate the disabled Container ID field and toggle it to Enabled; if the ID is corrupted, click Regenerate Container ID instead.
  • Apply changes and restart the SQL Server service (net stop MSSQLSERVER followed by net start MSSQLSERVER).

Step 3: Clear Orphaned Container Metadata

  • Open a query window in SQL Server Management Studio (SSMS) and run the following to inspect orphaned entries:
  SELECT * FROM msdb.dbo.sysssispackages WHERE container_status = 'disabled';
  • If orphaned records are found, remove them using EXEC sp_purge_container_metadata; (requires sysadmin role).
  • Restart the SQL Server Launchpad service to force a fresh container registration handshake.

Step 4: Check Group Policy and Security Settings

  • Run gpedit.msc and navigate to Computer Configuration > Administrative Templates > System > Device Guard.
  • Ensure Turn on Virtualization Based Security does not conflict with container isolation settings required by SQL Server.
  • If a conflicting policy is found, set it to Not Configured or Enabled with Container Support, then run gpupdate /force.

Alternative or Verification Steps

  • To verify the fix, run SELECT container_id, status FROM sys.dm_server_containers; in SSMS and confirm the status reads Active instead of Disabled.
  • If the error persists, uninstall and reinstall the SQL Server Container Feature Pack via Add or Remove Programs, then re-run the SQL Server Configuration Wizard to rebuild the container registry from scratch.

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

Troubleshooting Guide: Error 5598 — FILESTREAM Feature Not Supported on User Instances

Why This Error Happens

Error 5598 occurs because FILESTREAM functionality is architecturally incompatible with SQL Server User Instances, a lightweight instance type typically spun up by SQL Server Express for non-administrative users. Since User Instances do not have access to the full instance-level configuration required to manage FILESTREAM’s integration with the Windows NTFS file system, any attempt to enable or use FILESTREAM within this context is rejected. This is not a bug but a hard architectural limitation enforced by the SQL Server Database Engine on Windows Server 2025 / Windows 11.

Step-by-Step Resolution Guide

Step 1: Disable User Instance Connections

  • Locate your application’s connection string (often in web.config, app.config, or a .json settings file).
  • Remove or set the User Instance=True; parameter to User Instance=False;.
  • Example corrected string: Server=.\SQLEXPRESS;Database=MyDB;Integrated Security=True;User Instance=False;

Step 2: Enable FILESTREAM at the Instance Level

  • Open SQL Server Configuration Manager on Windows Server 2025 / Windows 11.
  • Navigate to SQL Server Services, right-click your target instance (e.g., SQL Server (MSSQLSERVER)), and select Properties.
  • Go to the FILESTREAM tab and check:
  • “Enable FILESTREAM for Transact-SQL access”
  • “Enable FILESTREAM for file I/O streaming access”
  • Click Apply, then restart the SQL Server service for changes to take effect.

Step 3: Configure FILESTREAM via T-SQL

  • Open SQL Server Management Studio (SSMS) and connect to a standard (non-user) instance.
  • Run the following script to enable FILESTREAM access level at the engine level:
  EXEC sp_configure filestream_access_level, 2;
  RECONFIGURE;
  • Ensure you are connecting via a standard named instance (e.g., SERVERNAME\SQLEXPRESS) rather than the |DataDirectory| user-instance shortcut often used in Visual Studio/Express projects.

Step 4: Migrate to a Standard Named Instance

  • If your project relies on a local .mdf file via User Instance for portability, migrate the database to a fully managed Standard or Express instance.
  • Use the Attach Database feature in SSMS to attach the .mdf and .ldf files to the standard instance manually.
  • Update your connection string to point directly to this new instance name rather than using the dynamic user-instance file path.

Alternative or Verification Steps

  • Verify the Fix: Run SELECT SERVERPROPERTY('FilestreamConfiguredLevel'); in SSMS. A return value of 2 or 3 confirms FILESTREAM is active at the instance level and ready for use.
  • Alternative Solution: If User Instances are required for your specific lightweight deployment scenario, consider storing large binary objects (BLOBs) using standard VARBINARY(MAX) columns instead of FILESTREAM, as this data type does not carry the same User Instance restrictions.

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

Troubleshooting Guide: SQL Server Error 5597 — FILESTREAM Feature Could Not Be Initialized

Why This Error Happens

This error occurs because FILESTREAM is disabled at the Windows operating system level, even though it may be enabled within SQL Server itself via sp_configure. SQL Server 2025 requires the FILESTREAM access level to be enabled at both the SQL Server Configuration Manager (OS integration) layer and the instance-level configuration layer for the feature to initialize correctly. When these two layers are out of sync—most commonly after a fresh install, an OS upgrade to Windows Server 2025/Windows 11, or a restored configuration—the instance fails to initialize FILESTREAM and throws Error 5597.

Step-by-Step Resolution Guide

Step 1: Enable FILESTREAM in SQL Server Configuration Manager

  • Open SQL Server Configuration Manager (search for SQLServerManager17.msc or the version-specific equivalent for SQL Server 2025).
  • Navigate to SQL Server Services, right-click your instance (e.g., SQL Server (MSSQLSERVER)), and select Properties.
  • Go to the FILESTREAM tab and check all three boxes as needed:
  • “Enable FILESTREAM for Transact-SQL access”
  • “Enable FILESTREAM for file I/O streaming access”
  • “Allow remote clients to have streaming access to FILESTREAM data” (if required)
  • Click Apply, then OK.

Step 2: Enable FILESTREAM at the SQL Server Instance Level

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Run the following T-SQL to enable FILESTREAM access at the instance level:
EXEC sp_configure 'filestream access level', 2;
RECONFIGURE;
  • Value 2 enables full Transact-SQL and Win32 streaming access; use 1 for T-SQL only access.

Step 3: Restart the SQL Server Service

  • Return to SQL Server Configuration Manager.
  • Right-click the SQL Server instance under SQL Server Services and select Restart.
  • Alternatively, restart via PowerShell with elevated privileges:
Restart-Service -Name 'MSSQLSERVER' -Force

Step 4: Verify Windows Group Policy and Local Security Settings

  • On Windows Server 2025/Windows 11, confirm no Group Policy Object (GPO) is blocking filesystem-level streaming or WMI access required by Configuration Manager.
  • Check Local Security Policy > Local Policies > User Rights Assignment to ensure the SQL Server service account has sufficient privileges (e.g., “Log on as a service”).
  • If running in a domain environment, confirm with the Active Directory administrator that no domain-level policy is overriding local FILESTREAM settings.

Step 5: Check File System Share Name Conflicts

  • If FILESTREAM still fails, verify there isn’t a naming conflict with the Windows file share used for FILESTREAM data.
  • Open Computer Management > Shared Folders > Shares and ensure no duplicate or orphaned shares conflict with the FILESTREAM share name configured in SQL Server.

Alternative or Verification Steps

  • Verify the fix by running SELECT * FROM sys.configurations WHERE name = 'filestream access level'; in SSMS — the value_in_use column should reflect 1 or 2 matching your Configuration Manager setting.
  • If the error persists after a restart, check the SQL Server Error Log (ERRORLOG file, typically located in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\) for additional details on which layer (OS vs. instance) is still misconfigured.

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

Troubleshooting Guide: SQL Server Error 5596 – FILESTREAM Configuration Inconsistent

Why This Error Happens

Error 5596 occurs when the FILESTREAM settings configured at the Windows OS level (via SQL Server Configuration Manager) do not match the FILESTREAM access level set inside the SQL Server instance itself (via sp_configure). This mismatch commonly arises after a manual registry edit, an incomplete server reboot following installation, or a failed patch/upgrade cycle (such as migrating to SQL Server 2025) that left the Windows service control registry keys out of sync with the instance-level setting. Because FILESTREAM requires alignment between the OS-level driver/share settings and the instance-level flag, SQL Server throws this warning to prevent silent data access failures on filestream-enabled databases.

Step-by-Step Resolution Guide

Step 1: Verify Current Configuration State

  • Open a new query window in SSMS and run EXEC sp_configure 'filestream access level' to check the current instance-level value.
  • Open SQL Server Configuration Manager → navigate to SQL Server Services → right-click your instance (e.g., SQL Server (MSSQLSERVER)) → select Properties → go to the FILESTREAM tab.
  • Compare the checkbox states (Enable FILESTREAM for Transact-SQL access, Enable read/write, Allow remote clients) against the sp_configure output.

Step 2: Reset FILESTREAM at the OS Level

  • In SQL Server Configuration Manager, uncheck all three FILESTREAM checkboxes, click Apply, then re-check the boxes you actually need (at minimum “Enable FILESTREAM for Transact-SQL access”), and click Apply again.
  • This forces Windows to rewrite the registry key at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL17.MSSQLSERVER\Filestream (path varies by instance name/version).
  • Restart the SQL Server service from the same Configuration Manager window to apply the OS-level change cleanly.

Step 3: Realign the Instance-Level Setting via T-SQL

  • Run the following in SSMS as a sysadmin:
  EXEC sp_configure filestream_access_level, 2;
  RECONFIGURE;
  • Use value 1 for Transact-SQL access only, or 2 for full read/write access including Win32 streaming (match whatever you enabled in Step 2).
  • Restart the SQL Server service once more so both layers (OS and instance) pick up the matching value.

Step 4: Clear Stale Configuration Cache (If Error Persists)

  • Stop the SQL Server service entirely via services.msc or Configuration Manager.
  • Delete/rename any orphaned FILESTREAM share folders under the data directory (e.g., C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\) only if they are confirmed unused and not tied to an active filegroup.
  • Restart the service and re-run Step 1 to confirm the checkbox states and sp_configure value now report identically.

Alternative or Verification Steps

  • Run SELECT * FROM sys.dm_os_loaded_modules WHERE name LIKE '%filestream%' and check SQL Server Error Log for “FILESTREAM: effective level = ” confirming the new setting took effect after restart.
  • If the inconsistency returns after every restart, uninstall and reinstall the FILESTREAM feature via Windows Features / Add Roles and Features on Windows Server 2025, then re-run SQL Server Setup in “Repair” mode to rebuild the feature cleanly.

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

Troubleshooting Guide: SQL Server Error 5595 – “.PhysicalPathName is disabled”

Why This Error Happens

This error typically occurs when a database file (.mdf, .ldf, or .ndf) references a physical path that SQL Server cannot access due to insufficient NTFS permissions for the SQL Server service account. It can also happen when the underlying volume or path has been marked offline, disconnected, or is residing on removable/disabled storage media. In some cases, this is triggered during database restore or attach operations where the original file path no longer exists or has been remapped incorrectly.

Step-by-Step Resolution Guide

Step 1: Verify the Physical File Path and Disk Status

  • Open Disk Management (diskmgmt.msc) on Windows Server 2025 / Windows 11 and confirm the volume hosting the database files is Online, not Offline or Disabled.
  • Check File Explorer to ensure the folder path referenced in SQL Server (e.g., D:\SQLData\YourDB.mdf) actually exists and is reachable.
  • Run sqlcmd -Q "SELECT name, physical_name, state_desc FROM sys.master_files;" to confirm the exact path SQL Server expects.

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

  • Right-click the folder containing the database files (e.g., D:\SQLData), select Properties > Security.
  • Add the SQL Server service account (commonly NT Service\MSSQLSERVER or a custom domain service account) with Full Control permissions.
  • Apply changes and restart the SQL Server service via services.msc or run:
  net stop MSSQLSERVER
  net start MSSQLSERVER

Step 3: Re-Enable or Reattach the Database File

  • If the file path was disabled due to a storage driver or BitLocker lock, re-enable the disk using:
  Mount-DiskImage -ImagePath "D:\path\to\disk.vhdx"
  • If the database is marked suspect or offline, bring it back online using SSMS or:
  ALTER DATABASE YourDB SET ONLINE;
  • If the physical file was moved, update the path using:
  ALTER DATABASE YourDB MODIFY FILE (NAME = YourDB_Data, FILENAME = 'D:\SQLData\YourDB.mdf');

Step 4: Check Group Policy and Storage Spaces Direct (S2D) Configuration

  • On Windows Server 2025, verify no Group Policy Object (GPO) is restricting access to removable or external storage, which can inadvertently disable physical paths.
  • If using Storage Spaces Direct or clustered storage, confirm the Cluster Shared Volume (CSV) is in a healthy state via Failover Cluster Manager.

Alternative or Verification Steps

  • Run sp_helpdb YourDB or query sys.databases to confirm the state_desc shows ONLINE and no file-related warnings appear in the SQL Server Error Log (ERRORLOG file).
  • If the issue persists, restore the database from a known-good backup to a healthy, accessible drive path and reconfigure permissions before bringing it online.

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

Troubleshooting Guide: Error 5594 in Microsoft SQL Server 2025

Why This Error Happens

Error 5594 occurs when a system function—typically HOST_NAME() or related T-SQL system functions that accept a computer_name_format parameter—receives an invalid or unsupported argument. This is usually caused by a mismatch between the SQL Server build version and the Database Compatibility Level, where newer format parameters (such as those introduced for FQDN resolution) are passed to an engine instance that doesn’t recognize them. It can also stem from corrupted system metadata or an outdated SQL Server Native Client/ODBC driver attempting to invoke the function with deprecated syntax.

Step-by-Step Resolution Guide

Step 1: Verify the SQL Server Build and Patch Level

  • Open SQL Server Management Studio (SSMS) and run SELECT @@VERSION; to confirm you are on a fully patched build of SQL Server 2025.
  • Check the Microsoft Release Notes to ensure Cumulative Update (CU) support for the computer_name_format parameter exists in your specific build.
  • Apply the latest CU via Windows Update or the standalone installer if the build is outdated.

Step 2: Correct the Function Syntax in the Query

  • Locate the query or stored procedure throwing the error (check Job History or the Error Log via EXEC sp_readerrorlog 0, 1, 'computer_name_format';).
  • Ensure the parameter value matches the exact accepted strings (e.g., 'short' or 'FQDN'), as values are case-sensitive and must be enclosed in single quotes.
  • Update the code: SELECT HOST_NAME('FQDN'); instead of using integer values or incorrect string literals.

Step 3: Reset Database Compatibility Level

  • Open a New Query window targeting the affected database.
  • Run ALTER DATABASE [YourDB] SET COMPATIBILITY_LEVEL = 170; (adjust level to match SQL Server 2025 standards).
  • Restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER to clear the query plan cache.

Step 4: Repair Corrupted System Function Metadata

  • Run DBCC CHECKDB('master') WITH NO_INFOMSGS, ALL_ERRORMSGS; to rule out corruption in system tables.
  • If corruption is found, restore the master database from a recent backup or rebuild system databases using the setup.exe /ACTION=REBUILDDATABASE command-line switch.

Alternative or Verification Steps

  • Verify: Re-run the original query or job step that failed; check the SQL Server Error Log (Management > SQL Server Logs in SSMS) to confirm Error 5594 no longer appears.
  • Alternative: If the error persists, bypass the native function by creating a CLR-based or PowerShell wrapper script to fetch the computer name via [System.Net.Dns]::GetHostName(), isolating the query from the native T-SQL bug.

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

Troubleshooting Guide: SQL Server Error 5592 – FILESTREAM Access Not Enabled

Why This Error Happens

Error 5592 occurs when an application or T-SQL statement attempts to use FILESTREAM functionality, but the feature has not been enabled at the Windows OS level and/or within the SQL Server instance configuration. By default, FILESTREAM is disabled during a standard SQL Server 2025 installation because it requires explicit file system access permissions that Windows does not grant automatically for security reasons. Without enabling both the SQL Server Configuration Manager setting and the corresponding sp_configure database engine option, SQL Server blocks any attempt to create or access FILESTREAM-enabled filegroups.

Step-by-Step Resolution Guide

Step 1: Enable FILESTREAM in SQL Server Configuration Manager

  • Open SQL Server Configuration Manager (search for sqlservermanager16.msc or locate it via Start Menu on Windows Server 2025/Windows 11).
  • Navigate to SQL Server Services, right-click your instance (e.g., SQL Server (MSSQLSERVER)), and select Properties.
  • Go to the FILESTREAM tab and check all three boxes:
  • Enable FILESTREAM for Transact-SQL access
  • Enable FILESTREAM for file I/O streaming access
  • Allow remote clients access to FILESTREAM data (if network access is required)
  • Set the Windows share name (default is MSSQLSERVER) and click Apply.

Step 2: Enable FILESTREAM Access Level via T-SQL

  • Open SQL Server Management Studio (SSMS) and connect to your instance.
  • Run the following commands to enable FILESTREAM at the engine level:
EXEC sp_configure 'filestream access level', 2;
RECONFIGURE;
  • Value 2 enables full Transact-SQL and Win32 streaming access; use 1 if only T-SQL access is needed.

Step 3: Restart the SQL Server Service

  • Restart the SQL Server service to apply the configuration changes:
Restart-Service -Name 'MSSQLSERVER' -Force
  • If using a named instance, replace MSSQLSERVER with MSSQL$<InstanceName>.
  • Verify Windows Firewall rules are not blocking the file share path (\\<ServerName>\MSSQLSERVER) if remote access is enabled.

Step 4: Validate Folder and Share Permissions

  • Ensure the SQL Server service account has Full Control permissions on the FILESTREAM data folder path.
  • Check via File Explorer → right-click the target folder → Properties → Security tab, and confirm the service account (e.g., NT SERVICE\MSSQLSERVER) is listed with appropriate permissions.

Alternative or Verification Steps

  • Run SELECT SERVERPROPERTY('FilestreamConfiguredLevel'); in SSMS — a return value of 2 confirms FILESTREAM is fully enabled.
  • If the error persists, try creating a test database with a FILESTREAM filegroup using a local path (e.g., C:\FSData) to rule out network share or permission conflicts as the alternative root cause.

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

Why This Error Happens

Error 5593 occurs because FILESTREAM relies on native 64-bit system calls to manage BLOB data directly on the NTFS/ReFS file system, and these calls are incompatible with the WoW64 (Windows 32-bit on Windows 64-bit) emulation layer. This typically happens when a 32-bit instance of SQL Server 2025 is installed or run on a 64-bit edition of Windows Server 2025 or Windows 11. Since FILESTREAM requires direct, unemulated access to the OS kernel for file I/O operations, SQL Server automatically disables the feature to prevent data corruption or access violations.

Step-by-Step Resolution Guide

Step 1: Verify Your SQL Server Architecture

  • Open SQL Server Management Studio (SSMS) and run SELECT @@VERSION;.
  • Check the output string for “x86” (indicates 32-bit) versus “x64” (indicates 64-bit).
  • If the result shows 32-bit, this confirms the WoW64 compatibility conflict causing Error 5593.

Step 2: Uninstall the 32-bit Instance

  • Navigate to Control Panel > Programs > Programs and Features.
  • Locate the 32-bit SQL Server 2025 instance (it will often be labeled explicitly or found in the C:\Program Files (x86)\Microsoft SQL Server\ directory).
  • Fully uninstall this instance to clear the WoW64 emulation conflict before reinstalling.

Step 3: Install the 64-bit SQL Server 2025 Instance

  • Download the standard (non-x86) installation media from the Microsoft Volume Licensing Center or official SQL Server portal.
  • Run the setup wizard and ensure the installation path defaults to C:\Program Files\Microsoft SQL Server\ (not the (x86) directory).
  • During the Database Engine Configuration step, select the FILESTREAM tab and check the boxes for “Enable FILESTREAM for Transact-SQL access” and “Enable FILESTREAM for file I/O streaming access.”

Step 4: Enable FILESTREAM via SQL Server Configuration Manager

  • Open SQL Server Configuration Manager (sqlserverManager16.msc or relevant version number for 2025).
  • Select SQL Server Services, right-click your instance, and choose Properties.
  • Go to the FILESTREAM tab and ensure “Enable FILESTREAM for Transact-SQL access” is checked, then click Apply.

Alternative or Verification Steps

  • To verify the fix, run EXEC sp_configure 'filestream access level'; in a new query window. A result value of 1 or 2 (rather than 0) confirms the feature is active and no longer blocked by WoW64.
  • If the error persists after reinstalling the 64-bit version, check the Windows Event Viewer under Applications and Services Logs > MSSQLSERVER to ensure no remnants of the old 32-bit registry keys (under HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SQL Server) are conflicting with the new instance.

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

Troubleshooting Guide: Error 5589 — FILESTREAM Access Under RCSI

Why This Error Happens

Error 5589 occurs because SQL Server 2025 does not support accessing FILESTREAM data through row-versioning-based isolation levels, specifically Read Committed Snapshot Isolation (RCSI) or Snapshot Isolation. This limitation exists because FILESTREAM data is stored as BLOBs on the NTFS/ReFS filesystem rather than in the database’s internal pages, so the Database Engine cannot apply row-versioning semantics to retrieve a transactionally consistent historical version of that file data. When a session attempts to read a FILESTREAM column while the database has RCSI enabled and the transaction is operating under snapshot semantics, the engine throws this error instead of returning inconsistent data.

Step-by-Step Resolution Guide

Step 1: Confirm the Database Isolation Level Configuration

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio connected to your Windows Server 2025 / Windows 11 instance.
  • Run the following query to check current settings:
SELECT name, is_read_committed_snapshot_on, snapshot_isolation_state_desc
FROM sys.databases
WHERE name = 'YourDatabaseName';
  • Confirm whether is_read_committed_snapshot_on is set to 1, which is the likely trigger for the FILESTREAM conflict.

Step 2: Force the Transaction to Use READ COMMITTED Locking for FILESTREAM Access

  • Rather than disabling RCSI database-wide (which can affect concurrency for other tables), isolate the FILESTREAM-related transaction using a table hint or isolation level override.
  • Modify the query that accesses FILESTREAM data to explicitly request locking-based isolation:
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
BEGIN TRAN
    SELECT FileData.PathName()
    FROM dbo.YourFileTable WITH (READCOMMITTEDLOCK)
    WHERE DocumentID = 101;
COMMIT TRAN
  • This forces the specific read to bypass the row-versioning engine and read the latest committed version directly.

Step 3: Disable RCSI at the Database Level (If Table Hints Are Not Feasible)

  • If your application cannot be modified to include hints, you may need to turn off RCSI entirely for the database.
  • Ensure no active connections are present, then run:
ALTER DATABASE YourDatabaseName
SET READ_COMMITTED_SNAPSHOT OFF
WITH ROLLBACK IMMEDIATE;
  • Note: This requires exclusive access to the database momentarily and will revert all sessions to default locking-based read committed behavior.

Step 4: Restart the SQL Server FILESTREAM Service Dependency

  • On Windows Server 2025 / Windows 11, open Services.msc and verify that the SQL Server VSS Writer and the FILESTREAM share (via SQL Server Configuration Manager) are running correctly.
  • Navigate to SQL Server Configuration Manager > SQL Server Services > [Your Instance] > Properties > FILESTREAM tab to confirm the share name matches your connection string.
  • Restart the SQL Server service to apply any configuration changes cleanly.

Alternative or Verification Steps

  • Verify the fix by re-running the original query or application process that previously threw Error 5589; it should now return the FILESTREAM data without exception.
  • As an alternative, if row-versioning is critical for your workload, consider migrating FILESTREAM BLOBs to a standard VARBINARY(MAX) column or implementing FileTable with explicit locking reads only for the specific transactions requiring snapshot consistency.

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

Troubleshooting Guide: SQL Server Error 5590 — FILESTREAM Operations Not Supported on the Platform

Why This Error Happens

Error 5590 occurs when FILESTREAM functionality is enabled at the SQL Server instance level (via sp_configure) but has not been properly enabled at the Windows operating system/service level, or when the underlying volume does not support the required filesystem features. This mismatch commonly happens after a fresh install of SQL Server 2025 on Windows Server 2025 or Windows 11 where the SQL Server Configuration Manager FILESTREAM settings were skipped, or when FILESTREAM is attempted on a volume formatted with an unsupported filesystem (such as ReFS in certain configurations or network-mapped drives). It can also occur if the SQL Server service account lacks the necessary rights to access the Windows FILESTREAM share.

Step-by-Step Resolution Guide

Step 1: Enable FILESTREAM at the Operating System Level

  • Open SQL Server Configuration Manager (run SQLServerManager17.msc or search for it in Start).
  • Navigate to SQL Server Services, right-click your instance (e.g., SQL Server (MSSQLSERVER)), and select Properties.
  • Go to the FILESTREAM tab and check all three boxes: “Enable FILESTREAM for Transact-SQL access,” “Enable FILESTREAM for file I/O streaming access,” and “Allow remote clients access to FILESTREAM data” (if needed).
  • Specify a valid Windows share name (e.g., MSSQLSERVER) and click Apply.

Step 2: Enable FILESTREAM at the SQL Server Instance Level

  • Open SQL Server Management Studio (SSMS) and connect to the instance.
  • Run the following T-SQL to enable FILESTREAM access level (0 = disabled, 1 = T-SQL only, 2 = full access):
EXEC sp_configure 'filestream access level', 2;
RECONFIGURE;
  • Restart the SQL Server service for changes to take effect (via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER).

Step 3: Verify the Target Volume Supports FILESTREAM

  • Confirm the drive hosting your FILESTREAM data container is formatted as NTFS (ReFS is only supported in specific SQL Server 2025 builds with limitations).
  • Check the volume using PowerShell:
Get-Volume -DriveLetter D | Select-Object FileSystemType
  • If the volume is ReFS and incompatible, migrate the FILESTREAM container path to an NTFS-formatted volume.

Step 4: Validate Service Account Permissions

  • Ensure the SQL Server service account has Full Control NTFS permissions on the folder path used for the FILESTREAM share.
  • Open File Explorer, right-click the FILESTREAM data folder (e.g., C:\SQLData\FileStreamContainer), go to Properties > Security, and add the SQL Server service account with Full Control.
  • Confirm the Windows “SQL Server FILESTREAM Share” is visible under \\<ServerName>\<ShareName> from a network path test.

Alternative or Verification Steps

  • To verify the fix, run SELECT SERVERPROPERTY('FilestreamConfiguredLevel'); in SSMS — a return value of 2 confirms full FILESTREAM access is active.
  • If the error persists, create a new FILESTREAM-enabled filegroup and table as a test case to confirm functionality end-to-end:
CREATE TABLE TestFS (ID INT PRIMARY KEY, FileData VARBINARY(MAX) FILESTREAM, RowGuid UNIQUEIDENTIFIER NOT NULL ROWGUIDCOL UNIQUE DEFAULT NEWID());

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

Troubleshooting Guide: Error 5591 – FILESTREAM Feature Disabled

Why This Error Happens

Error 5591 occurs when a database operation attempts to use FILESTREAM data but the feature has not been enabled at the SQL Server instance level. This typically happens because FILESTREAM access was never configured during installation, or the Windows service-level integration setting was turned off after a server migration or configuration change. Since SQL Server 2025 requires both an OS-level and instance-level flag to be set simultaneously, a mismatch between these two layers will trigger this error even if one of them appears correctly configured.

Step-by-Step Resolution Guide

Step 1: Enable FILESTREAM via SQL Server Configuration Manager

  • Open SQL Server Configuration Manager on Windows Server 2025 / Windows 11.
  • Navigate to SQL Server Services, right-click your instance (e.g., SQL Server (MSSQLSERVER)), and select Properties.
  • Go to the FILESTREAM tab and check Enable FILESTREAM for Transact-SQL access.
  • If network share access is required, also check Enable FILESTREAM for file I/O streaming access and specify a Windows Share Name.

Step 2: Enable FILESTREAM at the Instance Level via T-SQL

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Run the following command to match the access level configured in Step 1:
EXEC sp_configure filestream_access_level, 2;
RECONFIGURE;
  • Use level 1 for T-SQL only access, or 2 for full T-SQL and Win32 streaming access.

Step 3: Restart the SQL Server Service

  • Restart the SQL Server service to apply changes from both the OS and instance configuration layers.
  • You can do this via Services.msc or by running:
Restart-Service -Name "MSSQLSERVER" -Force
  • If using a named instance, replace MSSQLSERVER with the appropriate service name (e.g., MSSQL$INSTANCENAME).

Step 4: Validate FILESTREAM Filegroup and Database Configuration

  • Ensure the target database has a FILESTREAM filegroup created:
ALTER DATABASE YourDB
ADD FILEGROUP FileStreamGroup CONTAINS FILESTREAM;
  • Confirm the filegroup path points to a valid, accessible directory with correct NTFS permissions for the SQL Server service account.

Alternative or Verification Steps

  • Run SELECT * FROM sys.configurations WHERE name = 'filestream access level'; to confirm the value_in_use matches your intended setting (1 or 2).
  • If the error persists after a restart, check the Windows Event Viewer (Application log) for FILESTREAM-related service account permission errors, and verify the SQL Server service account has Full Control on the FILESTREAM data directory.

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

Troubleshooting Guide: Error 5585 – FILESTREAM File I/O Access Could Not Be Enabled

Why This Error Happens

This error occurs because FILESTREAM support is disabled at the Windows operating system level, even though it may be enabled within the SQL Server Database Engine settings. SQL Server 2025 requires both the OS-level file I/O streaming access and the instance-level configuration to be synchronized before it can mount FILESTREAM-enabled filegroups. Typically, this happens after a fresh install of SQL Server 2025 on Windows Server 2025 or Windows 11 where the administrator enabled FILESTREAM via T-SQL (sp_configure) but skipped the corresponding step in SQL Server Configuration Manager.

Step-by-Step Resolution Guide

Step 1: Open SQL Server Configuration Manager

  • Press Win + R, type SQLServerManager17.msc (version number may vary for SQL Server 2025 builds), and hit Enter.
  • Alternatively, search for “SQL Server 2025 Configuration Manager” directly in the Windows 11 Start Menu.
  • Navigate to SQL Server Network Configuration > SQL Server Services in the left-hand pane.

Step 2: Enable FILESTREAM on the Instance Properties

  • Right-click on your specific instance (e.g., SQL Server (MSSQLSERVER)) and select Properties.
  • Go to the FILESTREAM tab.
  • Check the box for Enable FILESTREAM for Transact-SQL access.
  • If you require access from remote clients, also check Enable FILESTREAM for file I/O streaming access and enter a valid Windows Share Name (e.g., MSSQLSERVER).
  • Click Apply and then OK to save the configuration.

Step 3: Restart the SQL Server Service

  • In the Configuration Manager, right-click the instance again and select Restart.
  • This is mandatory, as the OS-level FILESTREAM driver changes do not take effect on a running instance without a full service restart.

Step 4: Verify and Sync T-SQL Configuration

  • Open SQL Server Management Studio (SSMS) and connect to the instance.
  • Run the following query to ensure the instance-level setting matches the OS-level setting (set to 2 or 3 depending on remote access needs):
EXEC sp_configure filestream_access_level, 2;
RECONFIGURE;
  • Restart the SQL Server service one final time to ensure the T-SQL change and the OS-level change are fully synchronized.

Alternative or Verification Steps

  • Verification: Run SELECT SERVERPROPERTY('FilestreamConfiguredLevel'); in SSMS. If the result returns 2 or higher, the OS and SQL instance settings are successfully synced and the error should be resolved.
  • Alternative: If the GUI checkbox is grayed out or fails to save, manually enable the Windows Server 2025 role via PowerShell by running Enable-WindowsOptionalFeature -Online -FeatureName FileStream (if applicable to your build) or check Local Group Policy to ensure the “Local Security Authority” isn’t blocking the required FltMgr.sys driver from loading.

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

Troubleshooting Guide: SQL Server Error 5586 — FILESTREAM Already Configured

Why This Error Happens

Error 5586 occurs when sp_configure 'filestream access level' or the SQL Server Configuration Manager attempts to set FILESTREAM to a level that is already active on the instance. This is typically a benign, informational error, but it can also surface when configuration changes are applied through mismatched channels—for example, setting the value via T-SQL while the registry or Configuration Manager still holds a different cached state. It may also appear if a previous configuration change was not fully committed due to a failed service restart or a permissions issue preventing the write-back to the Windows registry.

Step-by-Step Resolution Guide

Step 1: Verify the Current FILESTREAM Configuration Level

  • Open SQL Server Management Studio (SSMS) and run EXEC sp_configure 'filestream access level'; to check the current runvalue and configvalue.
  • Confirm whether the value matches what you are attempting to set (0 = Disabled, 1 = T-SQL only, 2 = T-SQL and Win32 streaming).
  • If the values already match your intended setting, no further action is required—this error is expected behavior, not a failure.

Step 2: Check SQL Server Configuration Manager Settings

  • Open SQL Server Configuration Manager (search for SQLServerManager17.msc on Windows Server 2025/Windows 11).
  • Navigate to SQL Server Services, right-click your instance (e.g., SQL Server (MSSQLSERVER)), and select Properties.
  • Go to the FILESTREAM tab and confirm the checkboxes (Enable FILESTREAM for Transact-SQL access, Enable for I/O streaming access) reflect the level you want.
  • If Configuration Manager shows a different state than sp_configure, this mismatch is the root cause—apply changes here first, then restart the SQL Server service.

Step 3: Synchronize Registry and Service State

  • Open regedit and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQLServer\Filestream.
  • Confirm the EnableLevel DWORD value matches the level set in Configuration Manager (0, 1, or 2).
  • If it does not match, manually correct the registry value (ensure you have a backup/export first), then restart the SQL Server (MSSQLSERVER) service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.

Step 4: Reapply Configuration via T-SQL with RECONFIGURE

  • Run the following in SSMS as a sysadmin:
  EXEC sp_configure 'filestream access level', 2;
  RECONFIGURE;
  • If error 5586 persists, run RECONFIGURE WITH OVERRIDE; to force the engine to re-evaluate and reapply the setting.
  • Restart the SQL Server service afterward to ensure the change is fully committed.

Step 5: Validate Service Account Permissions

  • Ensure the SQL Server service account has Full Control on the FILESTREAM data folder path (e.g., F:\FILESTREAM_Data).
  • Check via icacls "F:\FILESTREAM_Data" in an elevated PowerShell/Command Prompt window.
  • Grant permissions if missing: icacls "F:\FILESTREAM_Data" /grant "NT SERVICE\MSSQLSERVER":(OI)(CI)F.

Alternative or Verification Steps

  • Run SELECT SERVERPROPERTY('FilestreamConfiguredLevel'), SERVERPROPERTY('FilestreamEffectiveLevel'); — both values should match your intended setting and confirm the change took effect.
  • If the issue persists after a service restart, drop and recreate the FILESTREAM filegroup on a test database to confirm the feature is functioning correctly at the engine level, independent of the configuration flag.

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

Microsoft SQL Server 2025 Troubleshooting Guide: Error 5588

Why This Error Happens

Error 5588 occurs because SQL Server’s FILESTREAM feature is architecturally incompatible with row-versioning-based isolation levels. When a transaction is running under SNAPSHOT isolation (or READ COMMITTED SNAPSHOT), SQL Server cannot guarantee a consistent point-in-time view of data stored outside the database file system (i.e., on the NTFS volume via FILESTREAM). This typically happens when an application or ORM (like Entity Framework) defaults the connection’s transaction isolation level to SNAPSHOT while simultaneously querying a table containing a VARBINARY(MAX) FILESTREAM column.

Step-by-Step Resolution Guide

Step 1: Identify the Conflicting Session Settings

  • Check your application’s connection string or ORM configuration (e.g., Entity Framework, Dapper) for explicit SET TRANSACTION ISOLATION LEVEL SNAPSHOT commands.
  • Run DBCC USEROPTIONS in SQL Server Management Studio (SSMS) during an active session to confirm the current isolation level.
  • Look specifically for queries that JOIN or SELECT against tables containing FILESTREAM columns while this setting is active.

Step 2: Switch the Database to READ COMMITTED Isolation

  • Open SSMS and connect to the Windows Server 2025 instance.
  • Execute the following T-SQL to verify if Snapshot Isolation is forced at the database level:
  SELECT snapshot_isolation_state_desc, is_read_committed_snapshot_on 
  FROM sys.databases 
  WHERE name = 'YourDatabaseName';
  • If is_read_committed_snapshot_on is 1, you must explicitly override the isolation level for the specific transaction accessing FILESTREAM data using: SET TRANSACTION ISOLATION LEVEL READ COMMITTED; before the BEGIN TRANSACTION statement.

Step 3: Modify Application-Level Transaction Scope

  • In your .NET or Java application code, locate the TransactionScope or connection object handling the file I/O.
  • Change the isolation level enum from IsolationLevel.Snapshot to IsolationLevel.ReadCommitted specifically for the code block handling SqlFileStream object instantiation.
  • Ensure the OpenSqlFilestream function call occurs within this newly adjusted transaction context to prevent the engine from defaulting back to row-versioning.

Step 4: Restart the SQL Server Service

  • Open the Services app (services.msc) on your Windows Server 2025 machine.
  • Locate SQL Server (MSSQLSERVER) or your specific named instance.
  • Right-click and select Restart to clear any cached execution plans that might be enforcing the old isolation level logic.

Alternative or Verification Steps

  • Verify the Fix: Re-run the specific query or application transaction that previously failed. If successful, the FILESTREAM data (image/document) should return without throwing the “Msg 5588” error in the SSMS output pane.
  • Alternative Workaround: If changing the isolation level is not feasible due to business logic requirements, refactor the data access layer to retrieve the FILESTREAM file path via GET_FILESTREAM_TRANSACTION_CONTEXT() in a separate READ COMMITTED transaction, decoupling it entirely from the main SNAPSHOT-based business logic transaction.

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

Troubleshooting Guide: SQL Server 2025 Error 5582 (FILESTREAM Reboot Pending)

Why This Error Happens

Error 5582 occurs when the Windows kernel-mode driver for FILESTREAM (WOF or the FILESTREAM filter driver, sqlflt.sys) is modified or enabled at the OS level but hasn’t been fully loaded into the running kernel session. This typically happens because SQL Server Configuration Manager changes the registry and driver bindings immediately, but Windows Server 2025 requires a full restart to re-initialize the storage filter driver stack. Until the reboot occurs, SQL Server detects a mismatch between the requested FILESTREAM state (enabled) and the actual loaded driver state (not loaded or previous configuration), triggering this blocking error.

Step-by-Step Resolution Guide

Step 1: Verify the Current Driver State

  • Open PowerShell as Administrator.
  • Run fltmc filters to check if sqlflt appears in the list of loaded filter drivers.
  • If it is missing despite being enabled in SQL Server Configuration Manager, this confirms the driver is staged but not active.

Step 2: Force a Full System Restart (Not a Service Restart)

  • Do not simply restart the “SQL Server (MSSQLSERVER)” service, as this will not reload the kernel driver.
  • Execute a full OS restart via shutdown /r /t 0 in an elevated Command Prompt.
  • Ensure no pending Windows Updates are queued, as this can sometimes interfere with the driver reload sequence on Windows Server 2025.

Step 3: Re-validate FILESTREAM Settings Post-Reboot

  • After the server restarts, open SQL Server Configuration Manager.
  • Navigate to SQL Server Services > Right-click your instance > Properties > FILESTREAM tab.
  • Confirm the checkboxes for “Enable FILESTREAM for Transact-SQL access” and “Enable FILESTREAM for file I/O streaming access” are checked and grayed out as saved (not requiring re-application).

Step 4: Update the SQL Server Instance Configuration

  • Open SQL Server Management Studio (SSMS) and connect via sysadmin credentials.
  • Run the following T-SQL to ensure the instance-level configuration matches the OS-level driver state:
EXEC sp_configure filestream_access_level, 2;
RECONFIGURE;
  • Restart the SQL Server service (standard service restart) to apply this specific instance-level change.

Alternative or Verification Steps

  • Verification: Run SELECT SERVERPROPERTY('FilestreamConfiguredLevel') in SSMS; a return value of 2 confirms the setting is fully active and matches the running kernel driver state.
  • Alternative: If the reboot loop persists, manually unload and reload the driver via an elevated prompt using sc.exe query sqlflt to check the STATE, followed by sc.exe start sqlflt if the state shows STOPPED rather than waiting for a Group Policy-driven restart.

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

Troubleshooting Guide: SQL Server Error 5583 — Invalid enable_level Parameter for sp_filestream_configure

Why This Error Happens

This error occurs when the enable_level parameter passed to sp_filestream_configure is set to a value outside the valid range of 0–3, or when it is set to a value higher than what the FILESTREAM feature is actually enabled for at the Windows Services level (via SQL Server Configuration Manager). Essentially, SQL Server validates the requested T-SQL configuration level against the OS-level FILESTREAM access setting, and a mismatch — often caused by skipping the Configuration Manager step or passing an incorrect integer/string value — triggers this failure. It can also happen if FILESTREAM was never enabled at the instance level prior to running the stored procedure.

Step-by-Step Resolution Guide

Step 1: Enable FILESTREAM at the Windows Service Level

  • Open SQL Server Configuration Manager (search for SQLServerManager17.msc or the version-specific equivalent on Windows Server 2025 / Windows 11).
  • Navigate to SQL Server Services, right-click your instance (e.g., SQL Server (MSSQLSERVER)), and select Properties.
  • Go to the FILESTREAM tab and check Enable FILESTREAM for Transact-SQL access.
  • Optionally check Enable FILESTREAM for file I/O streaming access if remote/file-share access is needed.
  • Click Apply, then restart the SQL Server service for changes to take effect.

Step 2: Verify the Correct enable_level Value

  • Valid values for enable_level are strictly: 0 (disabled), 1 (T-SQL access only), 2 (T-SQL + local I/O streaming), or 3 (T-SQL + local and remote I/O streaming).
  • Re-run the procedure with a valid integer value, for example:
EXEC sp_configure filestream_access_level, 2
RECONFIGURE
  • Avoid passing enable_level = 2 or 3 if you have not enabled the corresponding checkbox in Step 1 — this mismatch is the most common cause of Error 5583.

Step 3: Use sp_configure Instead if the Procedure Still Fails

  • If sp_filestream_configure continues to throw the error, bypass it and configure directly at the instance level:
EXEC sp_configure 'filestream access level', 1
RECONFIGURE
  • Restart the SQL Server service from Services.msc or Configuration Manager after making this change.

Step 4: Restart Dependent Services

  • Restart the SQL Server (instance name) service.
  • Restart SQL Server VSS Writer if FILESTREAM is used with backup/snapshot tools.
  • Confirm the Windows user account running SQL Server has the necessary local permissions on the FILESTREAM data folder path.

Alternative or Verification Steps

  • Run EXEC sp_configure 'filestream access level' and confirm the run_value column matches the level you intended to set (0–3).
  • If the error persists, check Windows Event Viewer (Application log, source: MSSQLSERVER) for additional detail tied to Error 5583, and confirm no Group Policy is blocking the FILESTREAM registry key under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL17.<InstanceName>\MSSQLServer\FilestreamShareName.

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

Troubleshooting Guide: SQL Server Error 5584 — FILESTREAM Configuration Conflict

Why This Error Happens

Error 5584 occurs when two or more sessions attempt to run sp_filestream_configure concurrently, causing SQL Server to lock the configuration process to prevent corruption of FILESTREAM settings. This is common when automated deployment scripts, configuration management tools (like DSC or Ansible), and manual DBA interventions overlap on the same instance. It can also surface if a previous sp_filestream_configure call did not terminate cleanly, leaving a stale session reference that blocks new configuration attempts.

Step-by-Step Resolution Guide

Step 1: Identify Active Sessions Running the Procedure

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Run the following query to find blocking sessions:
  SELECT session_id, status, command, blocking_session_id, wait_type
  FROM sys.dm_exec_requests
  WHERE command LIKE '%FILESTREAM%';
  • Note the session_id and blocking_session_id values for any long-running or orphaned sessions.

Step 2: Terminate the Conflicting Session

  • If a stale or orphaned session is found, terminate it safely:
  KILL <session_id>;
  • Confirm no other deployment scripts or configuration tools (e.g., PowerShell DSC resources, SCCM tasks) are scheduled to run sp_filestream_configure simultaneously.
  • Wait 10–15 seconds to allow SQL Server to release internal locks.

Step 3: Verify FILESTREAM Service-Level Settings

  • Open SQL Server Configuration Manager (search “SQL Server Configuration Manager” in Windows 11/Server 2025 Start menu).
  • Navigate to SQL Server Services → right-click your instance → Properties → FILESTREAM tab.
  • Ensure “Enable FILESTREAM for Transact-SQL access” is checked and matches the level you intend to set via sp_filestream_configure.

Step 4: Re-run the Configuration Procedure

  • Execute the procedure again in a single, isolated session:
  EXEC sp_filestream_configure @enable_level = 3;
  • Avoid running this command from multiple query windows or automation jobs at the same time.
  • Restart the SQL Server service if the setting still doesn’t apply:
  Restart-Service -Name 'MSSQLSERVER' -Force

Alternative or Verification Steps

  • Verify the fix by querying current FILESTREAM configuration: SELECT SERVERPROPERTY('FilestreamConfiguredLevel'), SERVERPROPERTY('FilestreamEffectiveLevel'); — both values should match your intended setting.
  • If the error persists, check Windows Event Viewer (Applications and Services Logs > MSSQLSERVER) for correlating Event IDs around the same timestamp, which may reveal a deeper permissions or service account issue requiring an SQL Server restart in single-user mode.

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

Troubleshooting Guide: SQL Server Error 5579 — FILESTREAM Effective Level Mismatch

Why This Error Happens

Error 5579 occurs when the FILESTREAM feature is enabled at a lower level in SQL Server Configuration Manager than what the SQL Server instance is attempting to use, resulting in an “effective level” that doesn’t match the database or instance-level FILESTREAM configuration. This typically happens because the Windows service-level FILESTREAM setting (controlled via the registry or SQL Server Configuration Manager) is disabled or set to “Transact-SQL access only,” while a database or application is requesting Win32 streaming access or remote client access. It can also occur after an in-place upgrade or migration to SQL Server 2025 on Windows Server 2025/Windows 11, where FILESTREAM registry keys were not correctly re-applied during setup.

Step-by-Step Resolution Guide

Step 1: Verify Current FILESTREAM Configuration Level

  • Open SQL Server Configuration Manager (sqlserverManager17.msc or later for SQL Server 2025).
  • Navigate to SQL Server Services, right-click your instance (e.g., MSSQLSERVER), and select Properties.
  • Go to the FILESTREAM tab and note which checkboxes are currently enabled (Win32 access, Remote clients, I/O streaming access).

Step 2: Enable FILESTREAM at the Required Level

  • Check “Enable FILESTREAM for Transact-SQL access” as the baseline requirement.
  • If your application requires file-level streaming, also check “Enable FILESTREAM for file I/O streaming access”.
  • If remote clients need access, check “Allow remote clients to have streaming access to FILESTREAM data” and specify the Windows share name.
  • Click Apply, then restart the SQL Server service for changes to take effect.

Step 3: Match the Instance-Level Configuration via T-SQL

  • Open SQL Server Management Studio (SSMS) and run the following to align the instance-level setting with the service-level setting:
EXEC sp_configure 'filestream access level', 2;
RECONFIGURE;
  • Use value 0 for disabled, 1 for Transact-SQL access only, or 2 for full access (Transact-SQL and Win32 streaming).
  • Restart the SQL Server service (net stop MSSQLSERVER followed by net start MSSQLSERVER) to apply the instance-level change.

Step 4: Check Windows Registry for Residual Misconfiguration

  • Open Registry Editor (regedit) and navigate to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL17.MSSQLSERVER\Filestream
  • Confirm the EnableLevel DWORD value matches the level configured in Step 2 (0, 1, 2, or 3).
  • If mismatched, correct the value manually, save, and restart the SQL Server service.

Step 5: Restart Dependent Services

  • Restart the SQL Server VSS Writer and SQL Server (MSSQLSERVER) services from services.msc.
  • On Windows Server 2025/Windows 11, also restart the Windows Management Instrumentation (WMI) service if FILESTREAM share visibility issues persist.

Alternative or Verification Steps

  • Run SELECT * FROM sys.database_filestream_options; and EXEC sp_configure 'filestream access level'; in SSMS to confirm both database and instance levels now match without triggering Error 5579.
  • If the error persists, uninstall and reinstall the FILESTREAM feature via SQL Server Installation Center > Maintenance > Repair, ensuring you reselect FILESTREAM support during the repair wizard.

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

Troubleshooting Guide: SQL Server Error 5580 – FILESTREAM InstanceGuid is Null

Why This Error Happens

This error occurs when the FILESTREAM registry keys associated with the SQL Server instance become corrupted, deleted, or improperly migrated, causing the InstanceGuid value to be missing or unreadable. It commonly surfaces after an in-place upgrade to SQL Server 2025, a failed patch installation, or manual edits to the registry that disrupted the MSSQLServer\Filestream key hierarchy. Without a valid InstanceGuid, the SQL Server service cannot initialize the FILESTREAM filter driver, preventing the database engine from starting or accessing FILESTREAM-enabled data.

Step-by-Step Resolution Guide

Step 1: Verify the Current FILESTREAM Registry State

  • Open the Registry Editor (regedit.exe) with administrative privileges.
  • Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL17.<InstanceName>\Filestream.
  • Check if the InstanceGuid value exists; if missing or blank, this confirms the corruption.
  • Export the current key as a backup before making any changes (File > Export).

Step 2: Rebuild the FILESTREAM Instance GUID

  • Stop the SQL Server service via services.msc or by running net stop MSSQLSERVER in an elevated Command Prompt.
  • Use SQL Server Configuration Manager to disable and then re-enable FILESTREAM support under the instance’s Properties > FILESTREAM tab.
  • This action forces SQL Server to regenerate a new InstanceGuid value in the registry upon the next service start.
  • Restart the service using net start MSSQLSERVER.

Step 3: Repair via Setup if Registry Rebuild Fails

  • If the GUID still fails to regenerate, launch SQL Server 2025 Setup from the installation media.
  • Select Maintenance > Repair and choose the affected instance.
  • Allow the repair process to complete, as this will restore the Filestream registry subkey structure to its default state.
  • Reboot the Windows Server 2025 / Windows 11 machine to ensure the filter driver (rsfx.sys) reloads correctly.

Step 4: Validate Permissions on the Registry Hive

  • Right-click the MSSQL17.<InstanceName> key and select Permissions.
  • Ensure the NT SERVICE\MSSQLSERVER (or named instance equivalent) account has Full Control.
  • Apply the changes and restart the SQL Server service to confirm the account can write the new GUID value.

Alternative or Verification Steps

  • Run SELECT SERVERPROPERTY('FilestreamConfiguredLevel'); in SQL Server Management Studio; a return value of 2 or 3 confirms FILESTREAM is active and the instance GUID is valid.
  • If the error persists after a repair, uninstall and reinstall the Database Engine component entirely, as a deeper MSI package corruption may be preventing the registry write operation.

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

Troubleshooting Guide: SQL Server Error 5581 — FILESTREAM Feature Disabled

Why This Error Happens

Error 5581 occurs when FILESTREAM is enabled at the SQL Server instance level (via sp_configure) but has not been correctly enabled at the Windows operating system level through SQL Server Configuration Manager, or vice versa. This mismatch typically happens because the FILESTREAM settings require changes in two separate places — the OS-level service property and the SQL Server instance configuration — and a pending change in either location requires a full service restart before it takes effect. Additionally, this error can surface if the SQL Server service account lacks the necessary permissions to access the FILESTREAM share, or if a previous configuration change was only partially applied.

Step-by-Step Resolution Guide

Step 1: Enable FILESTREAM at the Windows OS Level

  • Open SQL Server Configuration Manager (search for SQLServerManager17.msc or similar version-specific name on Windows Server 2025 / Windows 11).
  • Navigate to SQL Server Services, right-click your instance (e.g., SQL Server (MSSQLSERVER)), and select Properties.
  • Go to the FILESTREAM tab and check Enable FILESTREAM for Transact-SQL access.
  • If you need network/client access, also check Enable FILESTREAM for file I/O streaming access and specify a valid Windows share name (e.g., MSSQLSERVER).
  • Click Apply, then OK.

Step 2: Enable FILESTREAM at the SQL Server Instance Level

  • Open SQL Server Management Studio (SSMS) and connect using an account with sysadmin privileges.
  • Run the following T-SQL to enable FILESTREAM access at the engine level:
EXEC sp_configure 'filestream access level', 2;
RECONFIGURE;
  • A value of 0 disables FILESTREAM, 1 enables Transact-SQL access only, and 2 enables full access including I/O streaming.

Step 3: Restart the SQL Server Service

  • In SQL Server Configuration Manager, right-click the instance name and select Restart.
  • Alternatively, use PowerShell as Administrator:
Restart-Service -Name 'MSSQLSERVER' -Force
  • If using a named instance, replace MSSQLSERVER with MSSQL$<InstanceName>.

Step 4: Validate Service Account Permissions

  • Confirm the SQL Server service account has Full Control permissions on the folder path hosting the FILESTREAM data container.
  • Check Windows Firewall rules to ensure port 445 (SMB) is open if FILESTREAM I/O streaming is accessed remotely.
  • Re-run sp_configure to confirm the committed value matches the running value (see verification step below).

Alternative or Verification Steps

  • Run EXEC sp_configure 'filestream access level'; and confirm the run_value column matches the config_value column (both should show 2 if full access is desired) — a mismatch means the restart hasn’t fully applied the change.
  • If the error persists after a restart, check the SQL Server Error Log (via EXEC xp_readerrorlog 0, 1, N'FILESTREAM';) for additional details, and verify no Group Policy or third-party security software is blocking the FILESTREAM share creation.

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

Troubleshooting Guide: SQL Server Error 5576 — FILESTREAM Feature Enabled

Why This Error Happens

Error 5576 is not a failure condition; it is an informational log entry that SQL Server 2025 writes whenever the FILESTREAM feature has been successfully enabled on the instance, either through the SQL Server Configuration Manager or during setup. This message appears in the SQL Server Error Log simply to confirm that the FILESTREAM integration component has registered correctly at the OS level (Windows Server 2025 / Windows 11) and that the instance is now capable of storing BLOB data on the NTFS/ReFS filesystem via the Filestream.ndf container structure. No corruption, port conflict, or permission issue is implied by the message itself—it only becomes relevant if you did not intentionally enable this feature or if it is logged repeatedly alongside other errors.

Step-by-Step Resolution Guide

Step 1: Confirm Whether FILESTREAM Was Enabled Intentionally

  • Open SQL Server Configuration Manager → navigate to SQL Server Services.
  • Right-click your instance (e.g., MSSQLSERVER or named instance) → select Properties → go to the FILESTREAM tab.
  • Check if “Enable FILESTREAM for Transact-SQL access” is checked — if you did not expect this, uncheck it and click Apply.

Step 2: Validate Instance-Level Configuration via T-SQL

  • Open SQL Server Management Studio (SSMS) and run the following to confirm the current FILESTREAM access level:
  EXEC sp_configure 'filestream access level';
  • If you want to disable it programmatically instead of via Configuration Manager, run:
  EXEC sp_configure 'filestream access level', 0;
  RECONFIGURE;
  • Restart the SQL Server service for the change to take effect.

Step 3: Review Windows File Share Permissions

  • Since FILESTREAM relies on a Windows file share, open File Explorer and verify the share used for FILESTREAM data (commonly under C:\Program Files\Microsoft SQL Server\MSSQLx.INSTANCENAME\MSSQL\DATA\).
  • Ensure the SQL Server service account has Full Control NTFS permissions on this directory.
  • Confirm the share is listed correctly under Computer Management → Shared Folders → Shares.

Step 4: Check Error Log Context

  • Open SSMS → Management → SQL Server Logs → review entries surrounding Error 5576.
  • Confirm no accompanying errors (e.g., 5571, 5572) exist that indicate actual FILESTREAM filegroup creation failures.
  • If only 5576 appears with no further warnings, the message can safely be treated as informational and ignored.

Alternative or Verification Steps

  • To verify the fix, run EXEC sp_configure 'filestream access level'; again — a value of 0 confirms FILESTREAM is disabled, while 1 or 2 confirms it is active as intended.
  • If you intended to keep FILESTREAM enabled but want to suppress repeated informational logging, filter the SQL Server Error Log view in SSMS to exclude Event ID 5576 rather than disabling the feature.

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

Troubleshooting Guide: SQL Server Error 5577 (FILESTREAM Access Level Change)

Why This Error Happens

Error 5577 is an informational message that occurs when the FILESTREAM access level is modified via SQL Server Configuration Manager, sp_configure, or SSMS, but the change has not yet been fully applied because the SQL Server service has not been restarted. SQL Server caches the FILESTREAM access level at startup, so any modification to this registry/configuration value only partially applies until the service is cycled. This often happens after an administrator enables FILESTREAM support for Transact-SQL access or remote client access but forgets to restart the instance, leaving the server in an inconsistent state where new FILESTREAM operations may fail intermittently.

Step-by-Step Resolution Guide

Step 1: Verify the Current FILESTREAM Configuration Level

  • Open SQL Server Management Studio (SSMS) and connect to the Windows Server 2025 / Windows 11 instance.
  • Run the following query to check the current system-level setting:
  EXEC sp_configure 'filestream access level';
  • Confirm the run_value matches the intended level (0 = Disabled, 1 = T-SQL access enabled, 2 = Full access enabled for local and remote clients).

Step 2: Reconcile the Configuration Manager and SQL Setting

  • Open SQL Server Configuration Manager (search for SQLServerManager17.msc on Windows Server 2025/Windows 11).
  • Navigate to SQL Server Services > right-click your instance (e.g., SQL Server (MSSQLSERVER)) > Properties > FILESTREAM tab.
  • Ensure the checkbox for “Enable FILESTREAM for Transact-SQL access” (and “Enable remote client access” if needed) matches the sp_configure value set in Step 1.
  • Click Apply to sync the Windows-level and SQL-level settings.

Step 3: Restart the SQL Server Service

  • Open Services.msc or use Configuration Manager to restart the instance.
  • Alternatively, use PowerShell as Administrator:
  Restart-Service -Name 'MSSQLSERVER' -Force
  • If using a named instance, replace MSSQLSERVER with MSSQL$<InstanceName>.

Step 4: Confirm FILESTREAM Registry Settings (If Error Persists)

  • Open regedit and navigate to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL17.MSSQLSERVER\Filestream
  • Verify the EnableLevel DWORD value matches the level set in SSMS (0, 1, or 2).
  • If mismatched, manually correct the DWORD value and restart the SQL Server service again.

Alternative or Verification Steps

  • Run EXEC sp_configure 'filestream access level'; again after the restart to confirm config_value and run_value are now identical—this confirms the change is fully active.
  • If the error recurs on every restart, check for Group Policy Objects (GPOs) or third-party security tools on Windows Server 2025 that may be reverting the FILESTREAM registry key, and exclude the SQL Server registry path from policy enforcement.

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

Troubleshooting Guide: SQL Server Error 5578 — FILESTREAM Configuration Failure

Why This Error Happens

Error 5578 occurs when SQL Server 2025 attempts to enable or modify FILESTREAM settings but cannot complete the underlying Windows-level configuration changes. This is most commonly caused by the SQL Server service account lacking local administrative rights needed to modify system registry keys, a conflict with the FILESTREAM share name already existing on the host, or the SQL Server Configuration Manager service failing to communicate with the Windows Server 2025 kernel driver (FltMgr) that governs FILESTREAM’s filter driver. In some cases, Group Policy restrictions on Windows 11 workstations block the creation of the required file share entirely.

Step-by-Step Resolution Guide

Step 1: Verify FILESTREAM is Enabled at the Windows Level

  • Open SQL Server Configuration Manager and navigate to SQL Server Services.
  • Right-click your SQL Server instance (e.g., MSSQLSERVER) and select Properties.
  • Go to the FILESTREAM tab and ensure “Enable FILESTREAM for Transact-SQL access” is checked.
  • If enabling the share, confirm the Windows share name field does not conflict with an existing SMB share (check via net share in Command Prompt).

Step 2: Check Service Account Permissions

  • Confirm the SQL Server service account has local administrator rights on Windows Server 2025, as FILESTREAM requires registry and share-level write access.
  • Run services.msc, locate the SQL Server service, and verify the Log On As account.
  • Grant necessary permissions via:
  net localgroup Administrators "DOMAIN\SQLServiceAccount" /add
  • Restart the SQL Server service after applying changes.

Step 3: Enable FILESTREAM via T-SQL and sp_configure

  • Open a new query window in SSMS and run:
  EXEC sp_configure filestream_access_level, 2;
  RECONFIGURE;
  • Restart the SQL Server service for the change to take effect.
  • If the error persists, check the SQL Server error log (ERRORLOG file, typically in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\) for a more granular Windows API error code tied to Event ID 5578.

Step 4: Inspect Windows Registry and Driver State

  • Open regedit and navigate to:
  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FltMgr
  • Confirm the FltMgr service Start value is set to 0 (Boot) or 1 (System); if set to 4 (Disabled), change it to 1 and reboot.
  • Verify the FILESTREAM filter driver is loaded using:
  fltmc filters
  • Look for MSSQLFSF in the output list; if absent, reinstall the FILESTREAM feature via the SQL Server 2025 setup media (Repair option).

Alternative or Verification Steps

  • Confirm the fix by running EXEC sp_configure 'filestream_access_level'; — the run_value should return 2, and you should be able to create a test table using FILESTREAM column storage without error.
  • If the issue persists after all steps, uninstall and reinstall the Database Engine FILESTREAM feature via Add or Remove Programs > Microsoft SQL Server 2025 > Modify, ensuring no pending Windows Updates are queued that might lock the filter driver during installation.

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

Troubleshooting Guide: Error 5573 — FILESTREAM Tombstones Table Access Failure

Why This Error Happens

Error 5573 occurs when the SQL Server Database Engine cannot access the internal tombstones table that FILESTREAM uses to track deleted or garbage-collected BLOB data. This is typically caused by corrupted FILESTREAM data containers, insufficient NTFS permissions for the SQL Server service account on the FILESTREAM filegroup directory, or an interrupted garbage collection process that left the filesystem and metadata out of sync. It can also surface after an improper failover, storage disconnect, or abrupt shutdown while FILESTREAM operations were in progress.

Step-by-Step Resolution Guide

Step 1: Verify FILESTREAM Service Configuration and Permissions

  • Open SQL Server Configuration Manager and confirm FILESTREAM is enabled for the instance under SQL Server Services > Properties > FILESTREAM tab.
  • Check that the SQL Server service account has Full Control NTFS permissions on the FILESTREAM data directory (e.g., D:\SQLData\FilestreamContainer).
  • Run icacls "D:\SQLData\FilestreamContainer" from an elevated PowerShell prompt to confirm ACL entries include the SQL Server service account.

Step 2: Check FILESTREAM Filegroup and Container Health

  • Run DBCC CHECKFILEGROUP against the affected filegroup to detect corruption in the FILESTREAM container.
  • Inspect the Windows Event Viewer (Applications and Services Logs > MSSQLSERVER) for related I/O or storage errors coinciding with Event ID 5573.
  • Confirm the underlying disk/volume (especially if using Storage Spaces Direct or SAN-backed storage on Windows Server 2025) is not reporting latency or disconnect events.

Step 3: Rebuild or Restore the Tombstone Metadata

  • If corruption is confirmed, take the database offline using ALTER DATABASE [YourDB] SET OFFLINE.
  • Restore the database from the last known good backup that predates the corruption event.
  • Alternatively, run ALTER DATABASE [YourDB] SET FILESTREAM (GARBAGE_COLLECTION_INTERVAL = 0) temporarily to halt automated tombstone cleanup while you manually reconcile the container using the sys.filestream_tombstone_2005 internal table reference via a support-assisted DBCC trace.

Step 4: Restart SQL Server Services and Validate

  • Restart the SQL Server service via Restart-Service MSSQLSERVER -Force in PowerShell (run as Administrator).
  • Monitor the SQL Server Error Log immediately after restart using EXEC sp_readerrorlog 0, 1, 'FILESTREAM' to confirm the tombstone table initializes without the 0x%x HRESULT error.

Alternative or Verification Steps

  • Run a test INSERT/DELETE operation against a table containing a FILESTREAM column and confirm no 5573 errors appear in the SQL Server Error Log afterward.
  • If the error persists after container repair, perform a full database backup, then run DBCC CHECKDB WITH DATA_PURITY followed by a clean restore to a new FILESTREAM filegroup path to eliminate any residual container-level corruption.

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

Troubleshooting Guide: Error 5574 – Database Mirroring Incompatible with FILESTREAM/MEMORYOPTIMIZEDDATA

Why This Error Happens

Error 5574 occurs because SQL Server 2025 does not support combining legacy Database Mirroring with FILESTREAM or MEMORYOPTIMIZEDDATA (In-Memory OLTP) features on the same database. This is a hard architectural restriction, not a configuration bug, since mirroring cannot synchronize the filesystem-based FILESTREAM data or the checkpoint files used by memory-optimized filegroups between the principal and mirror servers. Attempting to enable mirroring on a database that already contains a FILESTREAM filegroup or a MEMORYOPTIMIZEDDATA filegroup will always trigger this error.

Step-by-Step Resolution Guide

Step 1: Confirm the Conflicting Feature

  • Run the following query to check for FILESTREAM or memory-optimized filegroups on the target database:
SELECT name, type_desc FROM sys.filegroups WHERE type_desc IN ('FILESTREAM_DATA_FILEGROUP', 'MEMORY_OPTIMIZED_DATA_FILEGROUP');
  • Identify whether the conflict is caused by FILESTREAM, In-Memory OLTP, or both.

Step 2: Choose an Alternative High-Availability Technology

  • Since Database Mirroring was deprecated starting in SQL Server 2012 and is fully removed from newer default workflows in SQL Server 2025, migrate to Always On Availability Groups instead.
  • Open SQL Server Configuration Manager on Windows Server 2025, enable the Always On Availability Groups service under the SQL Server service properties (High Availability tab), and restart the SQL Server service.
  • Always On Availability Groups natively support both FILESTREAM and MEMORYOPTIMIZEDDATA, unlike legacy mirroring.

Step 3: Remove the Conflicting Filegroup (If Mirroring Must Be Retained)

  • If Availability Groups are not an option and mirroring is mandatory, remove the FILESTREAM or memory-optimized filegroup from the database:
ALTER DATABASE [YourDB] REMOVE FILE [FileStreamGroupName];
ALTER DATABASE [YourDB] REMOVE FILEGROUP [FileStreamGroupName];
  • Ensure no tables reference FILESTREAM columns or memory-optimized tables before dropping the filegroup, as this operation is irreversible without a backup.

Step 4: Reconfigure Mirroring

  • Once the conflicting filegroup is removed, re-attempt to enable mirroring via SQL Server Management Studio (SSMS) under Database Properties > Mirroring, or via T-SQL:
ALTER DATABASE [YourDB] SET PARTNER = 'TCP://MirrorServer:5022';
  • Confirm the mirroring session establishes without throwing Error 5574.

Step 5: Validate Server-Level Compatibility

  • Check that both the principal and mirror instances are running the same SQL Server 2025 build and edition, since mismatched editions can cause secondary configuration failures after resolving the filegroup conflict.
  • Use SELECT @@VERSION; on both instances to confirm parity.

Alternative or Verification Steps

  • Verify the fix by querying sys.database_mirroring on the principal database — a non-null mirroring_state_desc value of SYNCHRONIZED confirms mirroring is active without errors.
  • If removing FILESTREAM/In-Memory OLTP is not feasible, use Log Shipping or Always On Availability Groups as a direct replacement, since both fully support these storage features in SQL Server 2025.

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

Troubleshooting Guide: SQL Server Error 5575

Why This Error Happens

Error 5575 typically occurs when SQL Server 2025 encounters a low-level I/O or file system operation failure while interacting with the Windows Server 2025 / Windows 11 storage subsystem. This is most commonly caused by corrupted database files, insufficient NTFS permissions on the data/log directories, or a failure returned by the underlying Windows API (reflected in the HRESULT) due to disk corruption, antivirus interference, or a locked file handle. In some cases, this also surfaces when FILESTREAM or memory-mapped file operations fail because the service account lacks the necessary privileges.

Step-by-Step Resolution Guide

Step 1: Identify the Exact File and HRESULT Code

  • Open the SQL Server Error Log via SSMS or C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Locate the full error string to extract the file path (%hs) and HRESULT value (%ls).
  • Cross-reference the HRESULT using certutil -error <HRESULTCode> in an elevated Command Prompt to decode the Windows-level meaning (e.g., access denied, disk full, file not found).

Step 2: Verify File System Permissions and Integrity

  • Right-click the affected data/log file folder (commonly C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA) and check Properties > Security.
  • Ensure the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control over the DATA, LOG, and Backup directories.
  • Run chkdsk C: /f /r from an elevated prompt and schedule a restart if the volume hosting the database files is suspected of corruption.

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

  • Open Windows Security > Virus & threat protection > Manage settings > Add or remove exclusions.
  • Add exclusions for the .mdf, .ndf, .ldf file paths and the sqlservr.exe process.
  • Restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.

Step 4: Run Database Consistency Checks

  • Open a query window in SSMS and execute DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;.
  • Review the output for allocation or structural errors tied to the file mentioned in the original error message.
  • If corruption is confirmed, restore from the last known good backup rather than attempting an in-place repair on production data.

Alternative or Verification Steps

  • After applying fixes, re-run the operation that originally triggered Error 5575 and monitor the ERRORLOG in real time using Get-Content -Path "ERRORLOG" -Wait in PowerShell.
  • If the error persists, detach the database, move the files to a different (non-corrupted) volume, and re-attach using CREATE DATABASE ... FOR ATTACH to rule out underlying disk hardware issues.

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

Why This Error Happens

Error 5570 occurs when the FILESTREAM filegroup’s internal garbage collection table—used to track and clean up orphaned BLOB files—becomes inaccessible or missing from the database’s system catalog. This typically happens due to a corrupted or incomplete FILESTREAM data container, a database that was improperly restored/attached without its associated filestream folder structure, or manual tampering with the filestream directory outside of SQL Server. It can also surface after an abrupt server crash during a garbage collection cycle, leaving metadata out of sync with the physical container on disk.

Step-by-Step Resolution Guide

Step 1: Verify FILESTREAM Configuration at the Instance Level

  • Open SQL Server Configuration Manager on Windows Server 2025/Windows 11.
  • Navigate to SQL Server Services > right-click your instance > Properties > FILESTREAM tab.
  • Confirm “Enable FILESTREAM for Transact-SQL access” and “Enable FILESTREAM for file I/O streaming access” are both checked.
  • Run the following to confirm at the engine level:
EXEC sp_configure 'filestream access level', 2;
RECONFIGURE;

Step 2: Check the Integrity of the FILESTREAM Container

  • Locate the physical filestream data folder (commonly under C:\SQLData\<DBName>_Filestream\).
  • Confirm the $FSLOG folder and garbage collection control file exist and were not deleted or moved manually.
  • If the container folder is missing or corrupted, restoring from a recent full backup is usually the safest route.

Step 3: Run Consistency Checks and Repair Database Metadata

  • Execute a full integrity check to identify catalog mismatches:
DBCC CHECKDB ('YourDatabaseName') WITH ALL_ERRORMSGS, NO_INFOMSGS;
  • If corruption is confirmed specifically in FILESTREAM metadata, take the database offline and attempt:
ALTER DATABASE YourDatabaseName SET EMERGENCY;
DBCC CHECKDB ('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS);
  • Bring the database back online and monitor the SQL Server Error Log for recurrence of Error 5570.

Step 4: Rebuild the FILESTREAM Filegroup (If Repair Fails)

  • Create a new FILESTREAM filegroup and file group container via SSMS or T-SQL.
  • Migrate FILESTREAM column data to the new filegroup using ALTER TABLE ... SWITCH or export/import routines.
  • Drop the old corrupted filegroup once data migration is verified complete.

Alternative or Verification Steps

  • After applying fixes, run DBCC CHECKDB once more and query sys.database_files to confirm the FILESTREAM filegroup status reads ONLINE with no pending errors.
  • If the issue persists, restore the entire database (including the FILESTREAM container) from the last known-good backup to a test instance, then reattach it to production to bypass unrecoverable garbage collection metadata.

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

Troubleshooting Guide: SQL Server Error 5571 – FILESTREAM Garbage Collection Table Access Failure

Why This Error Happens

Error 5571 occurs when the SQL Server Database Engine cannot internally access the hidden FILESTREAM garbage collection table associated with a filegroup. This is typically caused by corruption in the FILESTREAM data container, insufficient NTFS permissions for the SQL Server service account on the FILESTREAM directory, or an improperly configured/interrupted FILESTREAM filegroup after an OS or storage-level failure. In some cases, this also surfaces after migrating databases to a new Windows Server 2025 instance where the underlying file system ACLs were not preserved.

Step-by-Step Resolution Guide

Step 1: Verify FILESTREAM is Properly Enabled at the Instance Level

  • Open SQL Server Configuration Manager > right-click your SQL Server instance > Properties > FILESTREAM tab.
  • Ensure “Enable FILESTREAM for Transact-SQL access” and “Enable FILESTREAM for file I/O streaming access” are both checked.
  • Confirm via T-SQL:
EXEC sp_configure 'filestream access level';
  • If the value is 0, run:
EXEC sp_configure 'filestream access level', 2;
RECONFIGURE;

Step 2: Check NTFS Permissions on the FILESTREAM Data Folder

  • Navigate to the physical path of the FILESTREAM filegroup (e.g., D:\SQLData\FileStreamData).
  • Right-click the folder > Properties > Security tab.
  • Confirm the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control.
  • If missing, grant it manually:
icacls "D:\SQLData\FileStreamData" /grant "NT Service\MSSQLSERVER:(OI)(CI)F" /T

Step 3: Run Consistency Checks Against the Affected Database

  • Execute DBCC CHECKDB with the FILESTREAM data included to detect corruption:
DBCC CHECKDB ('YourDatabaseName') WITH ALL_ERRORMSGS, NO_INFOMSGS;
  • If corruption is confirmed in the FILESTREAM container, restore from the most recent clean backup rather than attempting in-place repair, as REPAIR_ALLOW_DATA_LOSS does not reliably fix FILESTREAM garbage collection metadata.

Step 4: Rebuild or Re-create the FILESTREAM Filegroup (If Corruption Persists)

  • If DBCC reports unrecoverable errors in the FILESTREAM filegroup, drop and recreate the filegroup:
ALTER DATABASE YourDatabaseName REMOVE FILE YourFileStreamLogicalName;
ALTER DATABASE YourDatabaseName ADD FILE 
(
    NAME = 'NewFileStreamData',
    FILENAME = 'D:\SQLData\NewFileStreamData'
) TO FILEGROUP FileStreamGroup1;
  • Migrate FILESTREAM columns/data to the new filegroup before dropping the old one.

Step 5: Restart the SQL Server Service and Validate Event Logs

  • Restart the SQL Server service via services.msc or PowerShell:
Restart-Service -Name 'MSSQLSERVER' -Force
  • Open Event Viewer > Windows Logs > Application and confirm Error 5571 no longer appears after the restart.

Alternative or Verification Steps

  • Run SELECT * FROM sys.filestream_tombstone and DBCC CHECKDB again post-fix to confirm the garbage collection table is accessible and no new corruption errors appear in the SQL Error Log.
  • If the error persists after permission and filegroup repairs, consider restoring the entire database to a new instance on Windows Server 2025 using a verified backup, as this isolates whether the root cause is storage/file-system level rather than database-level.

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

Troubleshooting Guide: SQL Server Error 5572 — FILESTREAM Filesystem Corruption

Why This Error Happens

Error 5572 occurs when the SQL Server Database Engine detects an inconsistency between its internal metadata and the actual state of the FILESTREAM data container on the NTFS filesystem. This is commonly caused by an improper shutdown, antivirus or backup software locking/modifying files in the FILESTREAM data directory, or underlying disk/storage corruption. It can also surface if NTFS permissions on the FILESTREAM container were altered outside of SQL Server’s control, breaking the link between the database engine and the file garbage collector.

Step-by-Step Resolution Guide

Step 1: Isolate the Database and Check Storage Health

  • Set the affected database to single-user or restricted-user mode to prevent further writes: ALTER DATABASE [YourDB] SET RESTRICTED_USER WITH ROLLBACK IMMEDIATE;
  • Run chkdsk D:\FILESTREAM_Volume /f /r (replace with your actual volume) to rule out physical disk-level corruption on Windows Server 2025/Windows 11.
  • Check Windows Event Viewer under Windows Logs > System for related NTFS or disk-driver errors (Event ID 7 or 55).

Step 2: Exclude FILESTREAM Directories from Antivirus and Backup Agents

  • Navigate to the FILESTREAM data container path (commonly C:\SQLData\FILESTREAM\) and add it as an exclusion in Windows Defender or any third-party AV via Windows Security > Virus & threat protection > Exclusions.
  • Ensure third-party backup agents (e.g., VSS-based tools) are not actively snapshotting or locking files in this directory during SQL Server operation.
  • Restart the SQL Server service after applying exclusions: Restart-Service -Name MSSQLSERVER.

Step 3: Run DBCC CHECKFILEGROUP and CHECKDB

  • Execute DBCC CHECKFILEGROUP ('FileStreamGroupName') WITH ALL_ERRORMSGS; to validate the FILESTREAM filegroup specifically.
  • Follow up with DBCC CHECKDB ('YourDB') WITH DATA_PURITY, ALL_ERRORMSGS; to scan for broader structural corruption.
  • Review the output for orphaned FILESTREAM pointers; note any file GUID mismatches reported.

Step 4: Repair or Rebuild the FILESTREAM Container

  • If corruption is confirmed and isolated to FILESTREAM data (not metadata), restore the affected filegroup from your most recent clean backup: RESTORE DATABASE [YourDB] FILE = 'FileStreamLogicalName' FROM DISK = 'E:\Backups\YourDB.bak' WITH NORECOVERY;
  • If no backup is viable, remove and recreate the FILESTREAM filegroup container, then re-import data from an application-level source if available.
  • Verify NTFS permissions on the container grant the SQL Server service account (e.g., NT SERVICE\MSSQLSERVER) Full Control.

Step 5: Return Database to Multi-User Mode

  • Once validated, switch the database back: ALTER DATABASE [YourDB] SET MULTI_USER;
  • Monitor the SQL Server Error Log for recurrence of Error 5572 over the next 24-48 hours.

Alternative or Verification Steps

  • Confirm the fix by running DBCC CHECKFILEGROUP again — a clean pass with zero allocation or consistency errors confirms resolution.
  • If the error persists after repair attempts, perform a full RESTORE DATABASE from the last known-good full backup plus transaction logs, as FILESTREAM corruption at the NTFS level often cannot be repaired in-place without data loss.

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

Troubleshooting Guide: SQL Server Error 5559 – “Could Not Open the Database”

Why This Error Happens

Error 5559 typically occurs when SQL Server 2025 cannot access a database file due to the file being in an inconsistent state, often caused by an improperly completed FILESTREAM or memory-optimized filegroup operation. This can also result from file system permission restrictions on the database container directory, or because the database was left in a transitional state after a failed upgrade or restore operation. In some cases, Windows Server 2025 security policies or antivirus/EDR software may lock the underlying container files, preventing SQL Server’s Database Engine from mounting them correctly.

Step-by-Step Resolution Guide

Step 1: Verify Database and Filegroup Container Status

  • Open SQL Server Management Studio (SSMS) and run SELECT name, state_desc FROM sys.databases WHERE name = 'YourDatabaseName'; to check if the database is marked as SUSPECT, RECOVERY_PENDING, or OFFLINE.
  • Cross-reference with SELECT * FROM sys.database_files; to confirm the physical file paths (especially for memory-optimized FILESTREAM containers) still exist on disk.
  • Check the SQL Server Error Log located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for accompanying messages referencing the specific container GUID folder.

Step 2: Correct File System Permissions and Unlock Containers

  • Navigate to the database’s root folder (commonly D:\SQLData\YourDatabase\ or wherever FILESTREAM filegroups reside).
  • Right-click the folder, select Properties > Security, and ensure the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control.
  • Temporarily disable Windows Defender real-time scanning or add an exclusion for the SQL data directory via Windows Security > Virus & threat protection > Manage settings > Add exclusion.
  • Restart the SQL Server service using net stop MSSQLSERVER followed by net start MSSQLSERVER in an elevated PowerShell terminal.

Step 3: Run Consistency Checks and Repair

  • Execute DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to identify corruption in the container structure.
  • If corruption is confirmed and no clean backup is available, set the database to emergency mode using ALTER DATABASE YourDatabaseName SET EMERGENCY; followed by ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE; then run DBCC CHECKDB ('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS);.
  • Set the database back to multi-user mode once repairs are complete: ALTER DATABASE YourDatabaseName SET MULTI_USER;.

Step 4: Restore From Backup (If Repair Fails)

  • If DBCC repair does not resolve the container issue, restore the database from the most recent full backup using RESTORE DATABASE YourDatabaseName FROM DISK = 'E:\Backups\YourDatabase.bak' WITH REPLACE;.
  • Apply any subsequent differential or transaction log backups to minimize data loss.

Alternative or Verification Steps

  • After applying fixes, confirm the database is accessible by running SELECT state_desc FROM sys.databases WHERE name = 'YourDatabaseName'; and verifying it returns ONLINE.
  • If the issue persists, use the SQL Server Configuration Manager to confirm the service is running under the correct account with network access to the storage volume, and check Windows Event Viewer (Windows Logs > Application) for disk I/O errors (Event ID 9 or 153) that may indicate underlying storage hardware failure.

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

Troubleshooting Guide: Error 5560 – FILESTREAM Tombstone Table Conflict

Why This Error Happens

Error 5560 occurs when SQL Server’s internal garbage collection process for FILESTREAM data attempts to access the tombstone table while another transaction or background task is already holding a conflicting lock on it. This is commonly triggered by long-running transactions that touch FILESTREAM columns, an overlapping manual invocation of sp_filestream_force_garbage_collection, or a backup/restore operation running concurrently against a database with FILESTREAM filegroups enabled. In rare cases, this can also surface due to filesystem-level latency on the FILESTREAM data container when running on NTFS/ReFS volumes under heavy I/O load.

Step-by-Step Resolution Guide

Step 1: Identify Blocking Sessions

  • Run sp_who2 or query sys.dm_exec_requests to locate sessions with wait_type related to FS_GARBAGE_COLLECTOR_SHUTDOWN or FILESTREAM_FILE_IO.
  • Cross-reference with sys.dm_tran_locks filtering on resource_type = 'FILESTREAM' to pinpoint the exact session ID (SPID) holding the conflicting lock.
  • Document the query or process name associated with the blocking SPID before taking action.

Step 2: Terminate or Wait Out the Conflicting Transaction

  • If the blocking session is a long-running user transaction, consider allowing it to complete naturally rather than killing it, as forced termination can cause rollback overhead on large FILESTREAM BLOBs.
  • If termination is necessary, use KILL <SPID> in SQL Server Management Studio (SSMS) and monitor rollback progress via sys.dm_exec_requests.
  • Avoid running manual garbage collection commands while backups are in progress.

Step 3: Reschedule Conflicting Maintenance Jobs

  • Open SQL Server Agent and check for overlapping jobs that call sp_filestream_force_garbage_collection or full database backups scheduled at the same interval.
  • Navigate to SQL Server Agent > Jobs in SSMS, right-click the job, and adjust the Schedule tab to stagger execution times by at least 15-30 minutes.
  • Ensure no PowerShell or Windows Task Scheduler scripts (Get-ScheduledTask on Windows Server 2025) are independently triggering filestream-related maintenance.

Step 4: Verify FILESTREAM Filegroup Health

  • Check the physical storage path (commonly C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\FILESTREAM\) for file-locking issues caused by antivirus or backup agents.
  • Exclude the FILESTREAM container directory from real-time antivirus scanning via Windows Security settings to prevent file-handle conflicts.
  • Restart the SQL Server (MSSQLSERVER) service only if the conflict persists after confirming no active transactions remain.

Alternative or Verification Steps

  • Re-run the operation that originally triggered Error 5560 and confirm it completes without blocking by checking sys.dm_tran_locks for FILESTREAM resource contention.
  • If the error persists, run DBCC CHECKDB with DATA_PURITY checks to rule out underlying tombstone table corruption, then restore from the last known good backup if structural damage is confirmed.

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

Troubleshooting Guide: Error 5561 — FILESTREAM Garbage Collector Operation Aborted

Why This Error Happens

This error occurs when SQL Server’s FILESTREAM garbage collector is interrupted before it can finish removing orphaned FILESTREAM data files from the filesystem. The most common root causes are a database shutdown, failover, or backup/restore operation occurring mid-cleanup cycle, as well as insufficient NTFS permissions on the FILESTREAM data container that prevent the garbage collector thread from deleting stale files. In some cases, antivirus or third-party backup agents locking files inside the FILESTREAM container can also abort the operation.

Step-by-Step Resolution Guide

Step 1: Verify FILESTREAM Service and Share Configuration

  • Open SQL Server Configuration Manager and confirm FILESTREAM is enabled for the relevant SQL Server 2025 instance under the FILESTREAM tab.
  • Ensure “Allow remote clients access to FILESTREAM data” is checked if accessed over the network.
  • Restart the SQL Server service only if a configuration change was made: net stop MSSQLSERVER && net start MSSQLSERVER.

Step 2: Check NTFS Permissions on the FILESTREAM Container

  • Navigate to the physical path of the FILESTREAM filegroup (e.g., D:\SQLData\FileStreamContainer\).
  • Right-click the folder, go to Properties > Security, and confirm the SQL Server service account has Full Control.
  • Also verify the NT SERVICE\MSSQLSERVER account is not blocked by inherited Group Policy restrictions on Windows Server 2025.

Step 3: Manually Trigger Garbage Collection

  • Run CHECKPOINT followed by a manual garbage collection trigger using the internal stored procedure:
  EXEC sp_filestream_force_garbage_collection N'YourDatabaseName';
  • Monitor SQL Server error logs for confirmation the GC cycle completed without a new abort message.

Step 4: Rule Out File Locking by External Processes

  • Temporarily exclude the FILESTREAM data folder from antivirus real-time scanning.
  • Check for open file handles using Resource Monitor or handle.exe (Sysinternals) against the FILESTREAM container path.
  • Pause any third-party backup agents during the next scheduled GC window to confirm they aren’t holding file locks.

Step 5: Rebuild or Repair Orphaned FILESTREAM Data (If Persistent)

  • If the error recurs consistently, take the database offline, run DBCC CHECKDB with FILESTREAM validation, and inspect for orphaned pointers.
  • As a last resort, detach and reattach the database, allowing the garbage collector to perform a full consistency pass during the next automatic cleanup cycle.

Alternative or Verification Steps

  • Check the SQL Server Error Log and Windows Event Viewer (Application log) to confirm Error 5561 no longer appears after the next automatic FILESTREAM GC cycle (typically triggered on checkpoint).
  • If the issue persists, as an alternative, migrate the FILESTREAM filegroup to a new volume with fresh NTFS permissions and re-run sp_filestream_force_garbage_collection to validate cleanup completes successfully.

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

Why This Error Happens

Error 5556 occurs when a FILESTREAM-related operation (such as GET_FILESTREAM_TRANSACTION_CONTEXT or a client call via the FILESTREAM API) references a database that either does not exist on the instance, is offline, or was never configured with FILESTREAM enabled at the database level. This typically happens because the FILESTREAM feature was enabled at the SQL Server instance level but not activated per-database, or the database name was misspelled/changed after migration. It can also surface after restoring a database to a new SQL Server 2025 instance where the instance-level FILESTREAM access level was reset to “Disabled” during setup.

Step-by-Step Resolution Guide

Step 1: Verify FILESTREAM Is Enabled at the Instance Level

  • Open SQL Server Configuration Manager on Windows Server 2025 / Windows 11.
  • Navigate to SQL Server Services → right-click your instance (e.g., MSSQLSERVER) → Properties → FILESTREAM tab.
  • Ensure “Enable FILESTREAM for Transact-SQL access” is checked, and optionally enable I/O streaming access if needed.
  • Restart the SQL Server service after applying changes.

Step 2: Confirm Instance-Level Configuration via T-SQL

  • Open SQL Server Management Studio (SSMS) and run:
  EXEC sp_configure filestream_access_level;
  • If the value is 0, enable it with:
  EXEC sp_configure filestream_access_level, 2;
  RECONFIGURE;
  • Restart the SQL Server (MSSQLSERVER) service from the Services console (services.msc) or Configuration Manager.

Step 3: Enable FILESTREAM at the Database Level

  • Confirm the target database exists:
  SELECT name FROM sys.databases;
  • If it exists but lacks FILESTREAM support, add a FILESTREAM filegroup:
  ALTER DATABASE YourDatabaseName
  ADD FILEGROUP FileStreamGroup CONTAINS FILESTREAM;

  ALTER DATABASE YourDatabaseName
  ADD FILE (NAME = FSData, FILENAME = 'C:\SQLData\FSData')
  TO FILEGROUP FileStreamGroup;
  • Ensure the path (e.g., C:\SQLData\FSData) exists and the SQL Server service account has write permissions.

Step 4: Validate the Database Name in the Application/Query

  • Double-check the exact spelling and case of the database name passed in your connection string or query.
  • Run the following to list all available databases supporting FILESTREAM:
  SELECT name, is_broker_enabled, containment_desc
  FROM sys.databases
  WHERE name = 'YourDatabaseName';

Alternative or Verification Steps

  • Run SELECT SERVERPROPERTY('FilestreamConfiguredLevel'); — a return value of 2 or 3 confirms Transact-SQL access is active at the instance level.
  • If the error persists after enabling FILESTREAM, try creating a brand-new test database with a FILESTREAM filegroup to confirm the feature works end-to-end, then compare its configuration against the problematic database using sys.filegroups.

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

Troubleshooting Guide: Error 5557 – FILESTREAM Container Does Not Exist

Why This Error Happens

Error 5557 typically occurs when the FILESTREAM data container referenced by a database has been moved, renamed, deleted, or was never properly initialized on disk. This can also happen if the SQL Server service account lacks the necessary NTFS permissions to access the container path, or if the FILESTREAM feature was disabled/misconfigured at the instance level after the database was created. Additionally, restoring a database backup onto a new server without recreating the matching FILESTREAM filegroup and container path will trigger this error.

Step-by-Step Resolution Guide

Step 1: Verify FILESTREAM is Enabled at the Instance Level

  • Open SQL Server Configuration Manager on Windows Server 2025 / Windows 11.
  • Navigate to SQL Server Services > right-click your instance > Properties > FILESTREAM tab.
  • Ensure “Enable FILESTREAM for Transact-SQL access” and “Enable FILESTREAM for file I/O streaming access” are checked.
  • Run the following T-SQL to confirm instance-level configuration:
  EXEC sp_configure 'filestream access level';
  • If the value is 0, set it to 2:
  EXEC sp_configure 'filestream access level', 2;
  RECONFIGURE;

Step 2: Confirm the FILESTREAM Container Path Exists

  • Check the physical path referenced in your FILESTREAM filegroup, typically found under:
    C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\FILESTREAM\
  • Run this query to list all available containers and their paths:
  SELECT name, physical_name 
  FROM sys.database_files 
  WHERE type_desc = 'FILESTREAM';
  • If the folder is missing, either restore it from backup or recreate the container using:
  ALTER DATABASE [YourDB] 
  ADD FILE (NAME = 'FS_Container', FILENAME = 'C:\FSData\FS_Container') 
  TO FILEGROUP FileStreamGroup1;

Step 3: Validate NTFS Permissions and Service Account Access

  • Right-click the FILESTREAM folder > Properties > Security tab.
  • Ensure the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control permissions.
  • Apply permissions via PowerShell if needed:
  icacls "C:\FSData\FS_Container" /grant "NT SERVICE\MSSQLSERVER:(OI)(CI)F"
  • Restart the SQL Server service to apply changes.

Step 4: Re-link Orphaned FILESTREAM Filegroups After Restore

  • If this error appeared after a database restore/migration, verify the filegroup mapping matches the new server’s folder structure.
  • Use sp_helpfile to check filegroup-to-path associations and correct any mismatches with ALTER DATABASE ... MODIFY FILE.

Alternative or Verification Steps

  • Run SELECT * FROM sys.master_files WHERE type_desc = 'FILESTREAM'; to confirm the container now resolves correctly without error.
  • If the issue persists, drop and recreate the FILESTREAM filegroup entirely, then re-import data from backup, as a corrupted metadata entry may require a full container rebuild.

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

Troubleshooting Guide: SQL Server Error 5558 — “Database Should Be in Single-User Mode”

Why This Error Happens

Error 5558 occurs when you attempt to run an operation that requires exclusive access to a database—such as renaming it, restoring certain system objects, or executing specific ALTER DATABASE commands—while the database is still configured for MULTI_USER access mode. SQL Server 2025 enforces this restriction because these operations modify low-level metadata or file structures that could become corrupted if other sessions are simultaneously reading or writing to the database. This is a safeguard, not a bug, and it typically happens when a DBA forgets to change the access mode before running maintenance tasks.

Step-by-Step Resolution Guide

Step 1: Identify Active Connections to the Database

  • Open SQL Server Management Studio (SSMS) and connect to the instance.
  • Run the following query to check for existing sessions:
  SELECT session_id, login_name, status, host_name
  FROM sys.dm_exec_sessions
  WHERE database_id = DB_ID('YourDatabaseName');
  • Note any active session_id values other than your own; these must be terminated before proceeding.

Step 2: Set the Database to Single-User Mode

  • Execute the following T-SQL command, replacing YourDatabaseName with your actual database name:
  ALTER DATABASE YourDatabaseName
  SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • The ROLLBACK IMMEDIATE clause forcibly disconnects all other users and rolls back any open transactions, so ensure no critical uncommitted work is in progress.
  • If you receive a permissions error, confirm your login has the ALTER ANY DATABASE server-level permission or is a member of the sysadmin fixed server role.

Step 3: Perform the Required Maintenance Operation

  • Run the original command that triggered Error 5558 (e.g., sp_renamedb, DBCC CHECKDB with repair options, or restoring a .bak file).
  • Example for renaming a database:
  ALTER DATABASE YourDatabaseName MODIFY NAME = NewDatabaseName;
  • Monitor the SQL Server Error Log (located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG by default) for confirmation that the command completed successfully.

Step 4: Revert the Database to Multi-User Mode

  • Once the operation is complete, restore normal access for applications and users:
  ALTER DATABASE YourDatabaseName
  SET MULTI_USER;
  • Confirm no application connection strings are hardcoded to expect single-user mode, which could cause application-side timeouts during this window.

Alternative or Verification Steps

  • Verify the fix by querying sys.databases and checking the user_access_desc column (SELECT name, user_access_desc FROM sys.databases WHERE name = 'YourDatabaseName';)—it should read MULTI_USER after Step 4.
  • If ROLLBACK IMMEDIATE fails due to a stuck session, restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER as a last resort, then retry Steps 2–4.

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

Troubleshooting Guide: SQL Server Error 5553 – FILESTREAM Manager Internal Error

Why This Error Happens

Error 5553 typically occurs when the FILESTREAM manager encounters a mismatch between the SQL Server database engine and the underlying NTFS filesystem permissions or directory structure. This often results from corrupted FILESTREAM container files, insufficient permissions on the SQL Server service account, or an interrupted I/O operation during a transaction involving FILESTREAM data. In some cases, this is triggered by antivirus software or Windows Defender actively scanning and locking files within the FILESTREAM data container, preventing SQL Server from completing read/write operations.

Step-by-Step Resolution Guide

Step 1: Verify FILESTREAM Service Account Permissions

  • Open Services.msc on Windows Server 2025 and locate the SQL Server service account.
  • Ensure the service account has Full Control permissions on the FILESTREAM data directory (typically located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\FILESTREAM).
  • Right-click the folder, go to Properties > Security, and add the SQL Server service account if missing.
  • Restart the SQL Server service after applying changes.

Step 2: Exclude FILESTREAM Directories from Antivirus Scanning

  • Open Windows Security > Virus & threat protection > Manage settings.
  • Under Exclusions, add the full FILESTREAM container path and the SQL Server data directory (e.g., D:\SQLData\FILESTREAM\).
  • Restart the SQL Server instance using net stop MSSQLSERVER followed by net start MSSQLSERVER in an elevated Command Prompt.

Step 3: 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 FILESTREAM-specific corruption flags (look for errors referencing FileTable or FILESTREAM column IDs).

Step 4: Rebuild the FILESTREAM Filegroup (If Corruption Confirmed)

  • Take the affected database offline using ALTER DATABASE [YourDatabaseName] SET OFFLINE;.
  • Remove the corrupted FILESTREAM container reference via ALTER DATABASE [YourDatabaseName] REMOVE FILE [FileStreamLogicalName];.
  • Re-add a fresh FILESTREAM container pointing to a new directory path and bring the database back online.
  • Restore any orphaned FILESTREAM data from the most recent full backup.

Alternative or Verification Steps

  • To verify the fix, insert a test record into a table using a FILESTREAM column and confirm the file writes successfully to the container directory without triggering Error 5553 in the SQL Server Error Log.
  • If the issue persists, consider migrating the FILESTREAM filegroup to a different physical disk volume, as underlying disk-level NTFS corruption (checked via chkdsk /f) may be the root cause rather than SQL Server configuration.

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

Why This Error Happens

Error 5554 occurs when SQL Server data or log files reside on a ReFS (Resilient File System) volume that uses block-cloning technology for features like Instant File Initialization, database snapshots, or backup/restore operations relying on Volume Shadow Copy (VSS). Each copy-on-write operation increments an internal file version counter, and ReFS enforces a hard ceiling (typically 8,192 versions per file) on how many of these references a single file can hold. When frequent snapshots, rapid growth/shrink cycles, or third-party backup tools repeatedly clone the same database file without ever “flattening” the version chain, the counter eventually maxes out and the file system refuses further write operations, which SQL Server surfaces as Error 5554.

Step-by-Step Resolution Guide

Step 1: Identify the Affected File and Active Snapshots

  • Run SELECT name, physical_name FROM sys.master_files; to locate the exact .mdf/.ldf file referenced in the error log.
  • Check for lingering database snapshots with SELECT name, source_database_id FROM sys.databases WHERE source_database_id IS NOT NULL;
  • Drop any unneeded snapshots: DROP DATABASE [YourDB_Snapshot];

Step 2: Reset the File’s Version Chain via Backup and Restore

  • Take a full native backup of the affected database: BACKUP DATABASE [YourDB] TO DISK = 'E:\Backups\YourDB_Full.bak';
  • Take the database offline or detach it: ALTER DATABASE [YourDB] SET OFFLINE;
  • Restore the backup to a newly created file on the same or a different volume, which forces ReFS to allocate a fresh file object with a reset version counter: RESTORE DATABASE [YourDB] FROM DISK = 'E:\Backups\YourDB_Full.bak' WITH MOVE 'YourDB_Data' TO 'E:\SQLData\YourDB_New.mdf', MOVE 'YourDB_Log' TO 'E:\SQLLogs\YourDB_New.ldf', REPLACE;

Step 3: Disable or Reconfigure ReFS Block Cloning

  • Open PowerShell as Administrator and check the volume’s file system: Get-Volume -DriveLetter E
  • If ReFS block-cloning is not required for your workload, migrate the volume to NTFS, or disable the Data Deduplication feature that triggers cloning: Disable-DedupVolume -Volume "E:"
  • For volumes that must remain ReFS, reduce snapshot frequency in your backup/VSS scheduler to limit version accumulation.

Step 4: Review Third-Party Backup/Snapshot Tools

  • Check scheduled tasks and backup software (e.g., VEEAM, Windows Server Backup) for overly aggressive snapshot intervals.
  • Adjust retention policies so that older versions are purged (vssadmin delete shadows /for=E: /oldest) before new ones accumulate.

Step 5: Apply Latest Windows Server 2025 Cumulative Update

  • Confirm you are running the latest Windows Server 2025 patch level via winver or Windows Update, since known ReFS version-counter handling fixes are periodically shipped as cumulative updates.
  • Restart the server after patching and re-run the affected SQL Server workload to confirm the fix.

Alternative or Verification Steps

  • Verify the fix by running the previously failing operation (e.g., a snapshot creation, bulk insert, or backup) and confirming no Error 5554 appears in the SQL Server error log (EXEC sp_readerrorlog;).
  • If the error persists, as a fallback, migrate the database files entirely to an NTFS-formatted volume, which does not impose the same per-file version ceiling as ReFS.

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

Troubleshooting Guide: SQL Server Error 5555 — FILESTREAM Data Cannot Be Renamed

Why This Error Happens

Error 5555 typically occurs when SQL Server attempts to perform a rename operation on a FILESTREAM-enabled file or directory while the underlying file is locked by the OS, an antivirus scanner, or an open file handle from another process. This can also result from NTFS permission misconfigurations on the FILESTREAM data container, where the SQL Server service account lacks the necessary rename/write/modify rights. In some cases, filesystem corruption or an interrupted I/O operation on the FILESTREAM filegroup directory leaves orphaned file handles that block subsequent rename transactions.

Step-by-Step Resolution Guide

Step 1: Verify FILESTREAM Service and Instance Configuration

  • Open SQL Server Configuration Manager and confirm FILESTREAM is enabled for the instance (right-click the SQL Server service → Properties → FILESTREAM tab).
  • Ensure “Enable FILESTREAM for Transact-SQL access” and “Enable FILESTREAM for file I/O streaming access” are both checked.
  • Run the following T-SQL to confirm the instance-level setting matches:
  EXEC sp_configure 'filestream access level';
  • If mismatched, set it with EXEC sp_configure 'filestream access level', 2; RECONFIGURE;

Step 2: Check and Repair NTFS Permissions on the FILESTREAM Directory

  • Navigate to the FILESTREAM data container path (e.g., D:\SQLData\FileStreamStore\).
  • Right-click the folder → Properties → Security tab, and confirm the SQL Server service account (e.g., NT SERVICE\MSSQLSERVER) has Full Control.
  • Use PowerShell to grant permissions if missing:
  icacls "D:\SQLData\FileStreamStore" /grant "NT SERVICE\MSSQLSERVER:(OI)(CI)F" /T
  • Restart the SQL Server service after applying permission changes.

Step 3: Release Locked File Handles and Exclude AV Scanning

  • Use Process Explorer (Sysinternals) to search for open handles on the FILESTREAM directory and terminate any conflicting process locking the file.
  • Add the FILESTREAM data folder and the SQL Server .mdf/.ldf/FILESTREAM container paths to your antivirus exclusion list, since real-time scanning often locks files mid-rename.
  • On Windows Server 2025 Defender, run:
  Add-MpPreference -ExclusionPath "D:\SQLData\FileStreamStore"

Step 4: Check for Filesystem Corruption

  • Run chkdsk D: /f /r (replace D: with your FILESTREAM volume) during a maintenance window to repair underlying NTFS inconsistencies.
  • Restart the server if prompted, then validate the volume health via fsutil dirty query D:.

Step 5: Rebuild or Reassociate the FILESTREAM Filegroup (If Issue Persists)

  • If renaming still fails at the SQL level, detach the affected database, verify the FILESTREAM filegroup path integrity, then reattach it using CREATE DATABASE ... FOR ATTACH.
  • Validate FILESTREAM filegroup consistency with:
  DBCC CHECKFILEGROUP (N'FileStreamGroup');

Alternative or Verification Steps

  • After applying fixes, attempt the original rename/update operation again and confirm no Error 5555 is thrown in SQL Server Error Logs (SQL Server Logs via SSMS → Management → SQL Server Logs).
  • As an alternative, if the issue persists only on a specific table, export the FILESTREAM data via OPENROWSET(BULK...), drop and recreate the FILESTREAM column, then re-import the data to bypass the corrupted file reference.

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

Troubleshooting Guide: Error 5550 – Multiple FILESTREAM Containers Not Supported

Why This Error Happens

This error occurs when a T-SQL script or migration attempts to add more than one FILESTREAM container (file path) to a single FILESTREAM filegroup using ALTER DATABASE ... ADD FILE. Standard and Express editions of SQL Server 2025 restrict each FILESTREAM filegroup to exactly one container, a limitation carried over from previous versions. This typically happens when restoring a database backed up on Enterprise Edition, or when copy-pasting deployment scripts written for a higher edition without verifying the current SQL Server edition’s feature set.

Step-by-Step Resolution Guide

Step 1: Identify the Current SQL Server Edition

  • Open SSMS and connect to the Windows Server 2025 instance.
  • Run SELECT SERVERPROPERTY('Edition'); to confirm whether you are on Standard, Express, or Developer edition.
  • Cross-reference the result with the “Features Supported by the Editions of SQL Server 2025” page in Books Online to confirm the single-container limitation applies.

Step 2: Review and Correct the ALTER DATABASE Script

  • Open the deployment or migration script that triggered Error 5550.
  • Locate the ALTER DATABASE [YourDB] ADD FILE (...) statement targeting the FILESTREAM filegroup.
  • Remove all but one FILENAME entry pointing to a container path (e.g., 'C:\SQLData\FS_Container1') within that specific FILEGROUP clause.
  • Save the corrected script before re-execution.

Step 3: Consolidate Existing Filegroups and Containers

  • If the error surfaced during a database restore, open SQL Server Configuration Manager and verify FILESTREAM access is enabled for the instance under SQL Server Services > [Your Instance] > Properties > FILESTREAM tab.
  • In SSMS, right-click the database, select Properties > Filegroups, and check if multiple FILESTREAM filegroups exist that could be merged instead of adding multiple containers to one.
  • Use sp_helpfile to list current file associations and confirm only one path maps to each FILESTREAM filegroup.

Step 4: Upgrade Edition (If Multi-Container Support Is Required)

  • If your workload genuinely requires multiple containers per filegroup for I/O load balancing, this feature requires SQL Server 2025 Enterprise Edition.
  • Navigate to Control Panel > Programs > SQL Server 2025 Installation Center and run the Edition Upgrade Wizard.
  • Input a valid Enterprise Edition product key and complete the upgrade before re-running the original multi-container script.

Alternative or Verification Steps

  • After applying the fix, re-run the original ALTER DATABASE statement; a successful execution with no Error 5550 confirms the filegroup now complies with edition limits.
  • As a workaround, create a second separate FILESTREAM filegroup and add the additional container to that new filegroup instead of forcing it into the existing one.

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

Troubleshooting Guide: SQL Server Error 5551 — FILESTREAM Filegroup File Limit Exceeded

Why This Error Happens

This error occurs because the edition of SQL Server 2025 in use (typically Standard, Web, or Express) enforces a restriction that limits a FILESTREAM filegroup to a single container file. Attempting to add a second FILESTREAM file to the same filegroup triggers this validation check, as multi-file FILESTREAM filegroups are an Enterprise-only capability. This is a licensing-based architectural limitation rather than a corruption or permissions issue.

Step-by-Step Resolution Guide

Step 1: Verify Your Current SQL Server Edition

  • Run SELECT SERVERPROPERTY('Edition'); in SSMS to confirm whether you are running Standard, Web, Express, or Enterprise.
  • Cross-reference the result with Microsoft’s edition comparison documentation to confirm multi-file FILESTREAM support eligibility.
  • If you are on a non-Enterprise edition, proceed to Step 2 rather than attempting further file additions.

Step 2: Create a New Filegroup Instead of Adding to the Existing One

  • Instead of adding a second file to the existing FILESTREAM filegroup, create a brand-new FILESTREAM filegroup.
  • Example T-SQL:
ALTER DATABASE YourDatabase
ADD FILEGROUP FileStreamGroup2 CONTAINS FILESTREAM;
  • Then add your new container file to this new filegroup:
ALTER DATABASE YourDatabase
ADD FILE (NAME = FSFile2, FILENAME = 'C:\SQLData\FSContainer2')
TO FILEGROUP FileStreamGroup2;
  • Ensure the path (e.g., C:\SQLData\FSContainer2) does not already exist, as SQL Server will create the folder automatically on Windows Server 2025 or Windows 11.

Step 3: Upgrade to Enterprise Edition (If Multi-File Support Is Required)

  • If your workload genuinely requires multiple container files in a single filegroup for I/O scaling, this feature is only supported on SQL Server Enterprise Edition.
  • Use the SQL Server Installation Center to perform an edition upgrade: Maintenance > Edition Upgrade.
  • Confirm post-upgrade status with SELECT SERVERPROPERTY('Edition'); before retrying the original ALTER DATABASE command.

Step 4: Review Existing Database Design for FILESTREAM Scaling

  • Audit all filegroups using:
SELECT name, type_desc FROM sys.filegroups WHERE type = 'FD';
  • Confirm each FILESTREAM filegroup currently contains only one file to prevent future failed deployment scripts.
  • Update any deployment or provisioning scripts (DACPAC, PowerShell DSC, or Terraform) to align with the single-file-per-filegroup constraint going forward.

Alternative or Verification Steps

  • Verify the fix by re-running the original ALTER DATABASE ... ADD FILE statement against the new filegroup — it should complete without Error 5551.
  • If an edition upgrade is not feasible, confirm the application’s FILESTREAM read/write patterns are efficient with a single container by monitoring disk I/O via Windows Performance Monitor (PhysicalDisk counters) on the hosting volume.

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

Troubleshooting Guide: SQL Server Error 5552 — FILESTREAM GUID File Missing or Inaccessible

Why This Error Happens

Error 5552 occurs when the SQL Server Database Engine attempts to access a FILESTREAM data container file identified by a specific GUID, but the file is missing from the filesystem, has been renamed/moved outside of SQL Server’s control, or is inaccessible due to NTFS permission restrictions. This commonly happens after an improper backup restore, manual manipulation of the FILESTREAM data folder, antivirus quarantine actions, or disk corruption affecting the underlying storage volume. It can also surface if the SQL Server service account lost its ACL permissions on the FILESTREAM container directory after a Windows Server 2025 security policy update or a domain/account change.

Step-by-Step Resolution Guide

Step 1: Verify the FILESTREAM Container and File Existence

  • Locate the FILESTREAM data file ID referenced in the error (the hex value 0x%x) using sys.database_files in the affected database.
  • Run: SELECT file_id, name, physical_name FROM sys.database_files WHERE type_desc = 'FILESTREAM';
  • Navigate to the physical path returned and confirm whether the GUID-named file/folder referenced in the error message actually exists under the $FSLOG or filestream data directory.
  • If the file is missing entirely, check Windows Server 2025 Backup history, Volume Shadow Copy (VSS) snapshots, or antivirus quarantine logs for recovery options.

Step 2: Check and Restore NTFS Permissions

  • Right-click the FILESTREAM root folder (e.g., D:\SQLData\FileStreamContainer) → Properties → Security tab.
  • Ensure the SQL Server service account (e.g., NT SERVICE\MSSQLSERVER or your custom domain service account) has Full Control permissions.
  • Run this PowerShell command to reset inheritance and reapply permissions:
  • icacls "D:\SQLData\FileStreamContainer" /grant "NT SERVICE\MSSQLSERVER:(OI)(CI)F" /T
  • Restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER after applying permissions.

Step 3: Run Database Consistency Checks

  • Execute DBCC CHECKDB (YourDatabaseName) WITH ALL_ERRORMSGS, NO_INFOMSGS; to detect broader corruption beyond the single FILESTREAM entry.
  • If DBCC reports FILESTREAM-specific allocation errors, note the repair level suggested (usually REPAIR_ALLOW_DATA_LOSS) only as a last resort.
  • For production systems, isolate the corrupted FILESTREAM BLOB by querying the affected table rather than repairing immediately, to avoid unnecessary data loss.

Step 4: Restore from a Known Good Backup

  • If the GUID file cannot be recovered or recreated, perform a restore using a verified full backup that includes FILESTREAM data: RESTORE DATABASE YourDatabaseName FROM DISK = 'E:\Backups\YourDatabase.bak' WITH FILESTREAM (DIRECTORY_NAME = 'YourFilestreamDirectory'), RECOVERY;
  • Confirm the backup media was taken after FILESTREAM was enabled and includes the full filestream container, not just the primary data file.

Alternative or Verification Steps

  • After applying fixes, re-run the triggering query or application process that calls the FILESTREAM data; confirm Error 5552 no longer appears in the SQL Server Error Log (EXEC xp_readerrorlog 0, 1;).
  • If the issue persists and no backup is available, consider exporting accessible FILESTREAM BLOBs via OPENROWSET(BULK...) to a new table before dropping and recreating the FILESTREAM filegroup entirely.

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

Troubleshooting Guide: SQL Server Error 5544 (FILESTREAM Remote Access Enabled)

Why This Error Happens

This message is logged when the FILESTREAM feature on SQL Server 2025 is configured with an “effective level” that permits remote client access to FILESTREAM data, typically because the FILESTREAM access level was set to a value of 2 (full remote access) either via SQL Server Configuration Manager or through the sp_configure 'filestream access level' setting. While technically informational rather than a fatal error, it often surfaces unexpectedly when a Group Policy Object (GPO) or a Windows Server 2025 security baseline forces a Windows Firewall rule change, or when the FILESTREAM share is exposed on a network interface that administrators did not intend to expose. This typically indicates a mismatch between the intended security posture (local-only access) and the actual running configuration (remote access enabled), which can trigger compliance or security scanning alerts.

Step-by-Step Resolution Guide

Step 1: Verify the Current FILESTREAM Configuration Level

  • Open SQL Server Management Studio (SSMS) and connect to the instance reporting Error 5544.
  • Run the following query to check the current server-level setting:
  • EXEC sp_configure 'filestream access level';
  • A run_value of 2 confirms remote access is currently enabled, matching the error message.

Step 2: Adjust the FILESTREAM Access Level via Configuration Manager

  • Open SQL Server Configuration Manager (search for SQLServerManager17.msc on Windows Server 2025/Windows 11).
  • Navigate to SQL Server Services, right-click your instance (e.g., MSSQLSERVER), and select Properties.
  • Go to the FILESTREAM tab and uncheck “Allow remote clients to have streaming access to FILESTREAM data” if remote access is not required.
  • Click Apply, then restart the SQL Server service for the change to take effect.

Step 3: Synchronize the Database Engine Configuration

  • Back in SSMS, run the T-SQL equivalent to match the Configuration Manager setting:
  • EXEC sp_configure 'filestream access level', 1; (use 1 for local-only, 0 to disable entirely, or 2 to intentionally keep remote access)
  • RECONFIGURE;
  • Restart the SQL Server (MSSQLSERVER) service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.

Step 4: Review Windows Firewall and Share Permissions

  • If remote access is genuinely required, ensure Windows Firewall on Windows Server 2025 allows traffic on the File Server Remote Management (SMB-In) rule rather than opening all SMB ports broadly.
  • Check the FILESTREAM share name via sp_configure or Configuration Manager’s “Windows share name” field and confirm NTFS/Share permissions are scoped only to required service accounts.

Alternative or Verification Steps

  • After restarting the service, re-run EXEC sp_configure 'filestream access level'; and confirm the run_value column matches your intended setting (0, 1, or 2).
  • If the error persists in the SQL Server Error Log despite configuration changes, check for conflicting Group Policy settings under Computer Configuration > Administrative Templates > Windows Components that may be overriding local FILESTREAM share settings on reboot.

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

Troubleshooting Guide: SQL Server Error 5545 — FILESTREAM Kernel Driver Connection

Why This Error Happens

Error 5545 is not an actual error — it is an informational message logged by SQL Server during startup to confirm that the FILESTREAM feature has successfully connected to its kernel-mode driver (RsFx). This message typically appears when FILESTREAM is enabled at the instance level and the SQL Server service initializes the driver that handles streaming BLOB data between the database engine and the NTFS/ReFS file system. It gets flagged or reported as a concern only because administrators sometimes mistake it for a warning when reviewing the SQL Server Error Log or Windows Event Viewer, when in reality it confirms correct FILESTREAM initialization.

Step-by-Step Resolution Guide

Step 1: Confirm This Is Informational Only

  • Open SQL Server Management Studio (SSMS) and navigate to Management > SQL Server Logs.
  • Locate the entry matching: FILESTREAM: effective level = 3, ... connected to kernel driver %ls.
  • Confirm the message severity is Informational (not Error/Warning) — no corrective action is required if FILESTREAM features are working as expected.

Step 2: Verify FILESTREAM Configuration Is Intentional

  • Open SQL Server Configuration Manager on Windows Server 2025 / Windows 11.
  • Right-click your instance (e.g., SQL Server (MSSQLSERVER)) → Properties → FILESTREAM tab.
  • Ensure “Enable FILESTREAM for Transact-SQL access” is checked only if your applications actually require it.
  • If FILESTREAM is not needed, uncheck all FILESTREAM options and restart the SQL Server service to suppress this message going forward.

Step 3: Validate the Driver and Service Dependencies

  • Open Device Manager → View > Show hidden devices → expand Non-Plug and Play Drivers.
  • Confirm RsFx0101 (or current version) driver is listed and shows This device is working properly.
  • From an elevated PowerShell prompt, run:
  Get-Service RsFx01010 | Select-Object Status, StartType
  • Ensure the service Status is Running and StartType is Automatic.

Step 4: Check File System and Share Permissions (If Using FILESTREAM Storage)

  • Navigate to your configured FILESTREAM share path, typically found via:
  SELECT * FROM sys.master_files WHERE type_desc = 'FILESTREAM';
  • Confirm the SQL Server service account has Modify permissions on the FILESTREAM data container folder.
  • Validate the Windows file share (if used) has matching NTFS and share-level permissions.

Alternative or Verification Steps

  • Restart the SQL Server instance and re-check SQL Server Logs; the 5545 message reappearing at startup with Informational severity confirms normal, expected behavior.
  • If FILESTREAM is not used by any application or database, disable it entirely via Configuration Manager and in sp_configure 'filestream access level', 0; followed by RECONFIGURE; to eliminate the message permanently.

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

Troubleshooting Guide: FILESTREAM Error 5546 – “Failed to Connect to Kernel Driver”

Why This Error Happens

This error occurs when the SQL Server FILESTREAM feature is enabled at the service level but the underlying kernel-mode driver (fltmgr.sys filter or the dedicated FILESTREAM driver) is not loaded, disabled, or improperly registered in Windows Server 2025 / Windows 11. It is typically caused by the FILESTREAM Windows service being disabled, a mismatch between the SQL Server configuration and the OS-level feature enablement, or corruption/removal of the driver files during an OS or SQL Server upgrade. In some cases, Group Policy or security software blocks the minifilter driver from attaching to the volume.

Step-by-Step Resolution Guide

Step 1: Verify the FILESTREAM Driver Service Status

  • Open Services.msc and locate “SQL Server FILESTREAM” or check via command line:
  • Run: sc query filestream in an elevated Command Prompt.
  • If the state shows STOPPED or the service is missing, this confirms the driver is not loaded into the kernel.

Step 2: Enable FILESTREAM at the Operating System Level

  • Open SQL Server Configuration Manager.
  • Navigate to SQL Server Services > right-click your instance (e.g., MSSQLSERVER) > Properties > FILESTREAM tab.
  • Check “Enable FILESTREAM for Transact-SQL access” and “Enable FILESTREAM for file I/O streaming access.”
  • Apply changes and restart the SQL Server service.

Step 3: Manually Reload the Kernel Driver

  • Open an elevated Command Prompt and run: sc start filestream
  • If it fails with error 1058 (service disabled), set the start type to automatic: sc config filestream start= demand
  • Reboot the server to ensure the driver initializes before SQL Server starts.

Step 4: Check Group Policy and Security Software Interference

  • Review local or domain Group Policy under Computer Configuration > Administrative Templates > System > Filter Manager for any restrictions on loading minifilter drivers.
  • Temporarily disable third-party antivirus/EDR software to rule out driver-blocking behavior, then retest.

Step 5: Repair or Reinstall SQL Server Database Engine Services

  • If the driver files are missing or corrupted (common after in-place OS upgrades to Windows Server 2025), run the SQL Server 2025 setup media.
  • Choose Repair for the instance, which restores the FILESTREAM kernel driver binaries to C:\Windows\System32\drivers\.

Alternative or Verification Steps

  • Confirm the fix by running sc query filestream again and verifying the state is RUNNING, then execute SELECT * FROM sys.dm_filestream_non_transacted_handles; in SSMS to ensure no errors are thrown.
  • If the issue persists, check the System Event Log for Filter Manager (FltMgr) errors, as a conflicting third-party minifilter driver may need to be temporarily unloaded using fltmc unload <DriverName>.

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

Troubleshooting Guide: SQL Server Error 5541 – FILESTREAM Open Mode Violation

Why This Error Happens

Error 5541 occurs when an application attempts to open a FILESTREAM data column using the Win32 file handle (via OpenSqlFilestream or SqlFileStream) without specifying a valid access mode, such as read, write, or read/write. This typically happens because the calling application passes an invalid or null AccessMode parameter, or because the transaction context attached to the FILESTREAM handle has already been committed, rolled back, or closed before the file operation executed. It can also surface when the NTFS permissions on the FILESTREAM data container conflict with the access mode requested by the client driver.

Step-by-Step Resolution Guide

Step 1: Verify FILESTREAM is Properly Enabled at the Instance Level

  • Open SQL Server Configuration Manager on Windows Server 2025/Windows 11.
  • Navigate to SQL Server Services → right-click your instance → Properties → FILESTREAM tab.
  • Confirm “Enable FILESTREAM for Transact-SQL access” and “Enable FILESTREAM for file I/O streaming access” are both checked.
  • Run the following T-SQL to confirm instance-level configuration matches:
  EXEC sp_configure filestream_access_level;
  RECONFIGURE;

Step 2: Review and Correct the Application Access Mode Parameter

  • Inspect the client code calling SqlFileStream (ADO.NET) or OpenSqlFilestream (native client).
  • Ensure the access mode argument explicitly matches one of: System.IO.FileAccess.Read, FileAccess.Write, or FileAccess.ReadWrite — never null or 0.
  • Confirm the mode requested aligns with the transaction isolation level; a read-only transaction cannot request Write access.
  • Example corrected C# snippet:
  SqlFileStream sfs = new SqlFileStream(path, transactionContext, FileAccess.ReadWrite);

Step 3: Validate Transaction Scope and Handle Lifetime

  • Ensure the FILESTREAM handle is opened within an active transaction and not after COMMIT or ROLLBACK has executed.
  • Confirm the transaction context byte array (GET_FILESTREAM_TRANSACTION_CONTEXT()) is retrieved immediately before the file open call.
  • Avoid reusing a transaction context across multiple threads or after the originating SqlTransaction object has been disposed.

Step 4: Check NTFS Permissions on the FILESTREAM Container

  • Navigate to the FILESTREAM data folder (e.g., D:\SQLData\FileStreamContainer\).
  • Right-click → Properties → Security tab.
  • Confirm the SQL Server service account has Modify and Read/Execute permissions, not just Read.
  • Apply changes and restart the SQL Server service if permissions were modified.

Alternative or Verification Steps

  • Re-run the failing operation using FileAccess.ReadWrite explicitly, then query sys.dm_tran_active_transactions to confirm the transaction remains open during the file I/O call.
  • If the error persists, bypass the Win32 handle approach entirely and use T-SQL UPDATE/INSERT with .WRITE() on the FILESTREAM column as a temporary workaround while debugging the client code.

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

Troubleshooting Guide: SQL Server Error 5542

Why This Error Happens

This error occurs when a FILESTREAM filegroup has been created in the database but no actual file has been added to it before attempting to insert or populate FILESTREAM-enabled data. SQL Server requires at least one file (acting as a container directory on disk) to be associated with the FILESTREAM filegroup so it has a physical location to store BLOB data. This typically happens when a developer creates the filegroup using ADD FILEGROUP ... CONTAINS FILESTREAM but forgets the subsequent ADD FILE statement, or when the file addition step fails silently due to path permissions.

Step-by-Step Resolution Guide

Step 1: Verify the Current Filegroup Configuration

  • Open SQL Server Management Studio (SSMS) and connect to your Windows Server 2025 instance.
  • Run the following query to confirm the filegroup exists but has no files:
SELECT fg.name AS FilegroupName, f.name AS FileName, f.physical_name 
FROM sys.filegroups fg
LEFT JOIN sys.database_files f ON fg.data_space_id = f.data_space_id
WHERE fg.type = 'FD';
  • If the FileName column returns NULL, this confirms the filegroup is empty.

Step 2: Add a File to the FILESTREAM Filegroup

  • Identify a valid directory path on the local disk (e.g., D:\SQLData\FileStreamData). Ensure this folder does not already exist, as SQL Server will create it automatically.
  • Execute the ALTER DATABASE command to add the file container:
ALTER DATABASE [YourDatabaseName] 
ADD FILE (
    NAME = FileStreamFile1, 
    FILENAME = 'D:\SQLData\FileStreamData'
) 
TO FILEGROUP [YourFileStreamFilegroupName];
  • Replace YourFileStreamFilegroupName with the exact name referenced in the Error 5542 message.

Step 3: Check Windows Service Account Permissions

  • Open Services.msc on Windows Server 2025 and locate the SQL Server (MSSQLSERVER) service.
  • Verify the service account (e.g., NT Service\MSSQLSERVER or a custom domain account) has Full Control permissions on the parent drive/directory (e.g., D:\SQLData\).
  • If permissions are missing, right-click the folder > Properties > Security > Edit, and add the SQL Server service account with Read/Write/Modify access.

Step 4: Enable FILESTREAM at the Instance Level (If Not Already Enabled)

  • Open SQL Server Configuration Manager.
  • Navigate to SQL Server Services, right-click your instance, and select Properties.
  • Under the FILESTREAM tab, ensure “Enable FILESTREAM for Transact-SQL access” is checked.
  • Restart the SQL Server service for changes to take effect via PowerShell:
Restart-Service -Name 'MSSQLSERVER' -Force

Alternative or Verification Steps

  • Verification: Re-run the query from Step 1. The physical_name column should now display the path you specified (e.g., D:\SQLData\FileStreamData), confirming the file is successfully linked to the filegroup.
  • Alternative: If the ALTER DATABASE command fails due to “Access Denied,” bypass local permission issues by creating the directory manually first using an elevated Command Prompt (mkdir D:\SQLData\FileStreamData) and granting the SQL service account ownership before retrying the ADD FILE command.

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

Troubleshooting Guide: FILESTREAM Error 5543 – Remote Access Disabled

Why This Error Happens

This error occurs because the FILESTREAM feature on SQL Server 2025 is configured at a level that only permits local (Transact-SQL) access, while a client or application is attempting to reach FILESTREAM data remotely over the network. The mismatch typically stems from the instance-level FILESTREAM configuration not being set to “Enabled for remote clients,” or the Windows service hosting SQL Server lacks the proper file share permissions. Additionally, the Windows Firewall or SMB share settings on Windows Server 2025 may be blocking the file streaming endpoint even if SQL Server itself is configured correctly.

Step-by-Step Resolution Guide

Step 1: Enable FILESTREAM for Remote Clients in SQL Server Configuration Manager

  • Open SQL Server Configuration Manager on Windows Server 2025 / Windows 11.
  • Navigate to SQL Server Services, right-click your instance (e.g., MSSQLSERVER), and select Properties.
  • Go to the FILESTREAM tab and check all three boxes: “Enable FILESTREAM for Transact-SQL access,” “Enable FILESTREAM for file I/O access,” and “Allow remote clients to have streaming access to FILESTREAM data.”
  • Click Apply, then restart the SQL Server service.

Step 2: Update the Instance-Level FILESTREAM Access Level via T-SQL

  • Open a new query window in SQL Server Management Studio (SSMS).
  • Run the following to set access level to 3 (full remote access):
EXEC sp_configure 'filestream access level', 3;
RECONFIGURE;
  • Restart the SQL Server service for changes to take effect.

Step 3: Verify Windows File Share and Firewall Permissions

  • Confirm the FILESTREAM share name matches what’s configured in SQL Server Configuration Manager (e.g., \\ServerName\MSSQLSERVER).
  • Open Windows Defender Firewall with Advanced Security and ensure inbound rules allow SMB traffic (TCP port 445) for the subnet or client IP range.
  • Check NTFS and share-level permissions on the FILESTREAM data container path (commonly under C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\) to ensure the SQL Server service account has Read/Write access.

Step 4: Restart Services and Validate Group Policy Settings

  • Restart the SQL Server (MSSQLSERVER) and SQL Server VSS Writer services from services.msc.
  • On Windows Server 2025, verify no Group Policy Object (GPO) is restricting SMB remote access or enforcing SMB signing that conflicts with FILESTREAM share protocols.

Alternative or Verification Steps

  • Run SELECT serverproperty('FilestreamEffectiveLevel'); in SSMS — a return value of 3 confirms remote access is now fully enabled.
  • If the issue persists, test connectivity using \\ServerName\ShareName from a remote machine’s File Explorer to isolate whether the problem is SQL Server configuration or a Windows networking/firewall restriction.

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

Troubleshooting Guide: SQL Server Error 5538 – Partial Updates Not Supported on FILESTREAM Columns

Why This Error Happens

This error occurs when a T-SQL UPDATE statement attempts to use the .WRITE() method on a varbinary(max) column that is backed by FILESTREAM storage. SQL Server’s FILESTREAM architecture streams data directly to the NTFS filesystem via the Win32 API, and this mechanism does not support partial or incremental byte-range updates in the same way standard BLOB columns do. The underlying root cause is almost always application code or an ORM-generated query issuing a chunked/partial write operation against a FILESTREAM-enabled column instead of performing a full replace or using the proper SqlFileStream API.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Capture the exact T-SQL statement using SQL Server Profiler, Extended Events, or the Query Store in SSMS.
  • Look specifically for UPDATE ... SET column.WRITE(...) syntax targeting a FILESTREAM column.
  • Cross-reference the table schema using sp_help 'TableName' to confirm the column has the FILESTREAM attribute.

Step 2: Modify the Application Logic to Avoid Partial Writes

  • Replace any .WRITE() partial update calls with a full column replacement, e.g., UPDATE Table SET FileColumn = @FullNewValue WHERE ID = @ID.
  • If large file streaming is required (uploads/downloads in chunks), refactor the application to use the SqlFileStream class (in System.Data.SqlTypes) instead of raw T-SQL partial updates.
  • Ensure the application opens a transaction context using GET_FILESTREAM_TRANSACTION_CONTEXT() before performing streaming I/O operations.

Step 3: Validate FILESTREAM Configuration on the Instance

  • Open SQL Server Configuration Manager on Windows Server 2025 / Windows 11, right-click your instance under SQL Server Services, and go to the FILESTREAM tab to confirm it is enabled for Transact-SQL access and I/O streaming access.
  • Verify the Windows share name matches what’s configured, typically found under Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL17.MSSQLSERVER\Filestream.
  • Run EXEC sp_configure 'filestream access level' in SSMS and confirm the value is set to 2 (full access) rather than 0 or 1.

Step 4: Rebuild or Patch the Affected Stored Procedures

  • If the partial write logic exists inside a stored procedure, locate it via sys.sql_modules by searching for the text .WRITE(.
  • Rewrite the procedure to accept the full binary payload as a parameter and perform a direct assignment rather than an incremental write.
  • Redeploy the updated procedure and clear the plan cache for that object using DBCC FREEPROCCACHE (plan_handle).

Alternative or Verification Steps

  • To verify the fix, re-run the original application workflow that triggered Error 5538 and confirm the UPDATE completes without exception; check the SQL Server error log at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for absence of Event ID 5538.
  • If refactoring the application isn’t immediately feasible, as a temporary workaround, perform a full DELETE + INSERT of the row instead of an UPDATE, which bypasses the partial-write restriction entirely.

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

Troubleshooting Guide: Error 5539 – ROWGUIDCOL Column Not Visible for FILESTREAM Operations

Why This Error Happens

Error 5539 occurs when SQL Server 2025 attempts to execute a FILESTREAM-related method (such as PathName() or similar Transact-SQL functions) on a table where the required ROWGUIDCOL property is either missing, hidden from the current query context, or not properly indexed. This typically happens because the uniqueidentifier column intended to serve as the row GUID lacks the ROWGUIDCOL property explicitly, or because the column is excluded from the result set (e.g., via a SELECT list that omits it or a view that doesn’t expose it) while a FILESTREAM method tries to reference it internally. Additionally, this can surface if the unique index backing the ROWGUIDCOL has been dropped, disabled, or corrupted, breaking the internal link between the FILESTREAM data and its GUID identifier.

Step-by-Step Resolution Guide

Step 1: Verify the ROWGUIDCOL Property Exists on the Table

  • Open SQL Server Management Studio (SSMS) and connect to your SQL Server 2025 instance.
  • Run the following query to check column metadata:
  SELECT name, is_rowguidcol 
  FROM sys.columns 
  WHERE object_id = OBJECT_ID('YourSchema.YourTable');
  • Confirm that exactly one uniqueidentifier column has is_rowguidcol = 1.

Step 2: Re-Apply the ROWGUIDCOL Property if Missing

  • If no column has the ROWGUIDCOL flag set, you must drop and recreate the column with the property explicitly defined, since ROWGUIDCOL cannot be altered on an existing column.
  • Example syntax for a new table or during a maintenance window:
  ALTER TABLE YourSchema.YourTable 
  ADD RowGuid UNIQUEIDENTIFIER ROWGUIDCOL NOT NULL DEFAULT NEWSEQUENTIALID();
  • Ensure a unique index is created on this column immediately after:
  CREATE UNIQUE INDEX UQ_YourTable_RowGuid 
  ON YourSchema.YourTable(RowGuid);

Step 3: Expose the Column in Views or Stored Procedures

  • Check any views or stored procedures that interact with the FILESTREAM data and ensure the ROWGUIDCOL column is explicitly included in the SELECT statement.
  • Avoid using SELECT * exclusions or column-level permissions (via DENY) that might hide this column from the calling context.
  • Update the view definition:
  CREATE OR ALTER VIEW dbo.vw_FileData AS
  SELECT FileID, FileData, RowGuid, FileData.PathName() AS FilePath
  FROM dbo.YourTable;

Step 4: Validate FILESTREAM Filegroup and Index Health

  • Run DBCC CHECKDB on the specific database to rule out corruption affecting the FILESTREAM filegroup or the unique index backing the ROWGUIDCOL.
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is found on the index, rebuild it using ALTER INDEX ... REBUILD.

Alternative or Verification Steps

  • Verification: Execute a test query calling the FILESTREAM method (e.g., SELECT FileData.PathName() FROM YourTable) directly against the base table (not a view) to confirm the GUID column is now resolving correctly without Error 5539.
  • Alternative: If the error persists despite a valid ROWGUIDCOL, check for conflicting Windows Server 2025 security policies or Group Policy restrictions on the FILESTREAM share path, as OS-level ACL changes can sometimes mask column visibility at the engine level.

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

Troubleshooting Guide: SQL Server Error 5540 — FILESTREAM Column ROWGUIDCOL Constraint Issue

Why This Error Happens

This error occurs because FILESTREAM data operations require a ROWGUID column that uniquely identifies each row at the storage level, and SQL Server enforces strict rules on this column to maintain file-to-row mapping integrity. Specifically, the ROWGUIDCOL property is assigned to a column that is either nullable or lacks a UNIQUE constraint (or PRIMARY KEY), which means SQL Server cannot guarantee a one-to-one relationship between table rows and their corresponding FILESTREAM data on disk. Without this guarantee, methods like PathName() or OpenSqlFilestream cannot reliably resolve which file corresponds to which row, so SQL Server blocks the operation entirely.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Table and Column

  • Run the following query to locate the FILESTREAM-enabled table and its associated ROWGUID column:
  SELECT c.name AS ColumnName, c.is_nullable, t.name AS TableName
  FROM sys.columns c
  JOIN sys.tables t ON c.object_id = t.object_id
  WHERE c.is_rowguidcol = 1;
  • Confirm whether is_nullable returns 1 (true), which indicates the root cause.
  • Also check if a UNIQUE or PRIMARY KEY constraint exists on this column via SQL Server Management Studio (SSMS) under Table > Keys.

Step 2: Alter the Column to Enforce NOT NULL

  • Open a new query window in SSMS connected to the affected database.
  • Modify the column definition to disallow NULL values:
  ALTER TABLE dbo.YourTableName
  ALTER COLUMN RowGuidColumn UNIQUEIDENTIFIER NOT NULL;
  • Replace YourTableName and RowGuidColumn with your actual table and column names.
  • If existing NULL values are present, update them first using NEWID() before applying the constraint.

Step 3: Add a Unique Constraint or Primary Key

  • Apply a UNIQUE constraint (or PRIMARY KEY, if not already defined) on the ROWGUIDCOL column:
  ALTER TABLE dbo.YourTableName
  ADD CONSTRAINT UQ_RowGuidColumn UNIQUE (RowGuidColumn);
  • Ensure no duplicate GUID values exist beforehand by running a GROUP BY check:
  SELECT RowGuidColumn, COUNT(*) 
  FROM dbo.YourTableName 
  GROUP BY RowGuidColumn 
  HAVING COUNT(*) > 1;

Step 4: Restart the SQL Server Service

  • Open Services.msc on Windows Server 2025 / Windows 11.
  • Locate SQL Server (MSSQLSERVER) or your named instance, right-click, and select Restart.
  • This ensures the FILESTREAM filegroup metadata cache is refreshed and recognizes the new constraints.

Alternative or Verification Steps

  • Re-run the original application method (e.g., OpenSqlFilestream or PathName()) against the table to confirm Error 5540 no longer appears in SSMS or the Windows Event Viewer under Applications and Services Logs > MSSQLSERVER.
  • If the error persists, drop and recreate the table with the ROWGUIDCOL, NOT NULL, and UNIQUE constraint defined together in the original CREATE TABLE statement, then migrate data using INSERT INTO ... SELECT to avoid legacy constraint conflicts.

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

Troubleshooting Guide: Error 5535 – FILESTREAM Data Container Corrupted

Why This Error Happens

Error 5535 occurs when the SQL Server Database Engine attempts to recover a database during startup or attach, but the NTFS directory structure backing the FILESTREAM filegroup does not match what is recorded in the database’s transaction log. This mismatch is typically caused by manual deletion or modification of files within the FILESTREAM data container outside of SQL Server, an improper shutdown that corrupted the filestream.hdr header file, or antivirus/backup software locking or altering files in the container path. Because FILESTREAM relies on the NTFS file system to store BLOB data while SQL Server maintains transactional consistency via pointers, any divergence between the physical folder structure and the metadata breaks recovery.

Step-by-Step Resolution Guide

Step 1: Verify the Integrity of the FILESTREAM Container

  • Navigate to the FILESTREAM data container path, typically found via: SELECT physical_name FROM sys.database_files WHERE type_desc = 'FILESTREAM';
  • Confirm the filestream.hdr file exists in the root of the container folder.
  • Check Windows Event Viewer under Windows Logs > Application for underlying NTFS or disk I/O errors (Event ID 55 or 140) that may indicate physical disk corruption.

Step 2: Isolate and Exclude External Interference

  • Open Windows Security > Virus & threat protection > Manage settings > Add or remove exclusions and add the full FILESTREAM container path (e.g., D:\SQLData\FileStreamContainer\).
  • Disable any third-party backup agents or file-sync tools (e.g., OneDrive, Robocopy scheduled jobs) that may be touching the directory.
  • Restart the SQL Server (MSSQLSERVER) service via services.msc or net start MSSQLSERVER after exclusions are applied.

Step 3: Attempt Database Recovery via EMERGENCY Mode

  • Open a new query window in SQL Server Management Studio (SSMS) connected via SQLCMD mode or a DAC connection.
  • Run the following to assess the damage:
  ALTER DATABASE YourDB SET EMERGENCY;
  DBCC CHECKDB (YourDB) WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is confirmed only in FILESTREAM data (not core relational pages), proceed to Step 4 rather than running REPAIR_ALLOW_DATA_LOSS.

Step 4: Restore the FILESTREAM Filegroup from Backup

  • Take a tail-log backup if the transaction log is still accessible: BACKUP LOG YourDB TO DISK = 'D:\Backups\YourDB_tail.trn' WITH NORECOVERY;
  • Restore the most recent full backup along with differential and log backups to a point before the corruption occurred:
  RESTORE DATABASE YourDB FROM DISK = 'D:\Backups\YourDB_Full.bak' WITH NORECOVERY;
  RESTORE LOG YourDB FROM DISK = 'D:\Backups\YourDB_tail.trn' WITH RECOVERY;
  • Ensure the FILESTREAM filegroup path specified during restore matches an accessible NTFS volume with equivalent permissions for the SQL Server service account.

Step 5: Rebuild Permissions on the Container Folder

  • Right-click the FILESTREAM container folder, go to Properties > Security, and confirm the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control.
  • Reset inheritance if broken using: icacls "D:\SQLData\FileStreamContainer" /reset /T
  • Re-apply correct ACLs with: icacls "D:\SQLData\FileStreamContainer" /grant "NT Service\MSSQLSERVER:(OI)(CI)F" /T

Alternative or Verification Steps

  • After recovery, run DBCC CHECKDB (YourDB) WITH NO_INFOMSGS; and confirm zero allocation or consistency errors related to FILESTREAM filegroups.
  • If the container remains unrecoverable, create a brand-new FILESTREAM filegroup, migrate BLOB data via INSERT INTO ... SELECT from a restored copy, and drop the corrupted filegroup once data integrity is confirmed.

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

Troubleshooting Guide: SQL Server Error 5536 — FILESTREAM Deleted Folder Corruption

Why This Error Happens

This error occurs when SQL Server’s FILESTREAM garbage collection process attempts to reconcile the internal “tombstone” table of deleted FILESTREAM directories against the actual NTFS filesystem state, and finds a mismatch or corruption in the folder structure. This is typically caused by an unexpected shutdown, antivirus/backup software interfering with FILESTREAM data containers while SQL Server had file handles open, or manual tampering with files inside the FILESTREAM data container outside of SQL Server’s control. On Windows Server 2025 and Windows 11, this is also frequently triggered by Windows Defender’s enhanced real-time protection scanning and locking files inside the FILESTREAM container during the deletion/garbage-collection cycle.

Step-by-Step Resolution Guide

Step 1: Take the Database Offline and Isolate the FILESTREAM Container

  • Stop the SQL Server service or take the affected database OFFLINE via SSMS to prevent further garbage collection attempts from writing to the corrupted folder.
  • Locate the FILESTREAM data container path (check sys.database_files or the database properties FILESTREAM filegroup path, typically under D:\SQLData\FILESTREAM\).
  • Navigate to the $FSLOG folder and the numeric GUID-named subfolder referenced in the error message to confirm the folder is missing, empty, or has broken ACLs.

Step 2: Exclude FILESTREAM Paths from Antivirus and Windows Defender

  • Open Windows Security > Virus & threat protection > Manage settings > Add or remove exclusions.
  • Add the full FILESTREAM container path (e.g., D:\SQLData\FILESTREAM\) and the $FSLOG subfolder as folder exclusions.
  • Run Set-MpPreference -ExclusionPath "D:\SQLData\FILESTREAM\" in an elevated PowerShell session on Windows Server 2025 to enforce this via policy.
  • Restart the SQL Server service to clear any stale file locks.

Step 3: Repair Permissions and NTFS Integrity on the Container

  • Verify the SQL Server service account has Full Control NTFS permissions on the FILESTREAM root folder and all subfolders (right-click folder > Properties > Security tab).
  • Run chkdsk D: /f /r (adjust drive letter) during a maintenance window to repair underlying NTFS corruption that may be causing orphaned or inaccessible folder entries.
  • Re-apply permissions recursively using icacls "D:\SQLData\FILESTREAM" /reset /T followed by granting the SQL Server service account access.

Step 4: Restore from Backup if Corruption Persists

  • If the folder structure cannot be repaired, restore the database from the last known good full backup plus transaction log backups using RESTORE DATABASE [YourDB] FROM DISK = 'backup.bak' WITH NORECOVERY, followed by log restores.
  • Ensure FILESTREAM filegroups are included in the backup set (WITH FILESTREAM was not excluded during backup) before attempting the restore.
  • Bring the database online with RESTORE DATABASE [YourDB] WITH RECOVERY once all logs are applied.

Alternative or Verification Steps

  • After applying fixes, run DBCC CHECKDB('YourDB') WITH ALL_ERRORMSGS and check the SQL Server error log for Event ID 5536 recurrence to confirm resolution.
  • If the issue persists, run DBCC CHECKFILEGROUP against the FILESTREAM filegroup specifically, and consider detaching/reattaching the database after manually rebuilding the $FSLOG folder structure with SQL Server service stopped.

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

Troubleshooting Guide: SQL Server Error 5537

Why This Error Happens

Error 5537 occurs when a Transact-SQL function such as PathName() or GetFileNamespacePath() is executed against a column that was not explicitly configured with the FILESTREAM attribute. This typically happens when developers copy query templates between tables without verifying schema definitions, or when a table was altered and the FILESTREAM attribute was inadvertently dropped from the varbinary(max) column. It can also occur if the query targets the wrong column entirely due to a naming collision between a regular binary column and its FILESTREAM counterpart.

Step-by-Step Resolution Guide

Step 1: Verify the Column Schema

  • Open SQL Server Management Studio (SSMS) and connect to the Windows Server 2025 instance.
  • Run the following query to check column properties:
  SELECT c.name, c.is_filestream 
  FROM sys.columns c
  WHERE c.object_id = OBJECT_ID('YourTableName');
  • Confirm that the is_filestream flag is set to 1 for the target column.

Step 2: Correct the Table Definition

  • If the attribute is missing, you cannot simply “add” it via ALTER COLUMN; you must recreate the column.
  • Create a new column with the correct attribute:
  ALTER TABLE YourTableName 
  ADD NewFileColumn VARBINARY(MAX) FILESTREAM NULL;
  • Migrate data from the old column to NewFileColumn, then drop the old column and rename the new one using sp_rename.

Step 3: Validate FILESTREAM Instance Configuration

  • Ensure FILESTREAM is enabled at the instance level, as missing configuration can sometimes cause the engine to ignore the attribute mapping.
  • Open SQL Server Configuration Manager > right-click your instance > Properties > FILESTREAM tab.
  • Check the box for Enable FILESTREAM for Transact-SQL access.

Step 4: Update the Query Logic

  • Modify your application code or stored procedure to reference the new, correctly configured column name.
  • Ensure the PathName() function call matches the exact column name verified in Step 1:
  SELECT NewFileColumn.PathName() FROM YourTableName;

Alternative or Verification Steps

  • Verification: Re-run the original query that triggered the error. If Error 5537 does not reappear and a valid UNC path is returned, the fix is successful.
  • Alternative: If recreating the column is not feasible immediately, restrict the application logic to skip the PathName() call for that specific table and use standard SELECT statements to retrieve the binary data directly instead.

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

Troubleshooting Guide: SQL Server Error 5532 (KTM Transaction Context Failure)

Why This Error Happens

This error occurs when SQL Server attempts to perform a transacted file system operation (such as instant file initialization or sparse file management for database snapshots) but cannot obtain a valid context from the Kernel Transaction Manager (KTM). This is typically caused by the Distributed Transaction Coordinator (MSDTC) or KTM services being disabled, misconfigured, or blocked by Group Policy on Windows Server 2025. It can also occur if the underlying volume does not support transactional NTFS (TxF) or if TxF has been deprecated/disabled at the OS level, which is increasingly common in newer Windows builds.

Step-by-Step Resolution Guide

Step 1: Verify Transactional NTFS (TxF) Support on the Volume

  • Open an elevated Command Prompt and run fsutil transaction query <DriveLetter>: to check if the volume supports TxF.
  • Note that Windows Server 2025 and Windows 11 have deprecated TxF in newer builds; if the volume returns “not supported,” this is likely your root cause.
  • Check the specific disk/volume where your SQL Server data and log files reside.

Step 2: Check and Restart Kernel Transaction Manager Dependencies

  • Open services.msc and verify the Distributed Transaction Coordinator (MSDTC) service is set to “Automatic” and is running.
  • Run net stop msdtc followed by net start msdtc to cycle the service.
  • Confirm no Group Policy Object (GPO) is disabling KTM-related system services via gpresult /h report.html.

Step 3: Review SQL Server Instant File Initialization (IFI) Settings

  • Open Local Security Policy (secpol.msc) and navigate to Local Policies > User Rights Assignment.
  • Confirm the SQL Server service account has the “Perform Volume Maintenance Tasks” privilege assigned.
  • If IFI relies on legacy TxF calls for snapshot/sparse file handling, disable this feature temporarily via SQL Server Configuration Manager to test if it resolves Error 5532.

Step 4: Update SQL Server 2025 Cumulative Update

  • Navigate to the Microsoft Update Catalog and download the latest Cumulative Update (CU) for SQL Server 2025.
  • Apply the update, as early builds may contain a known regression related to KTM calls on Server 2025/Windows 11 that was patched in subsequent CUs.
  • Restart the SQL Server service after installation: net stop MSSQLSERVER && net start MSSQLSERVER.

Alternative or Verification Steps

  • Verify the Fix: Attempt the file operation that triggered the error (e.g., database snapshot creation or restore) again and monitor the SQL Server Error Log for the absence of Event ID 5532.
  • Alternative Solution: If TxF remains unsupported on the OS, migrate the database files to a volume formatted specifically to support legacy Transactional NTFS, or reconfigure the specific feature (like snapshots) to use a non-transactional method if supported by your SQL Server edition.

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

Troubleshooting Guide: Error 5533 – FILESTREAM File System Log Record Missing

Why This Error Happens

This error occurs when the FILESTREAM log folder’s internal log records become desynchronized from the actual FILESTREAM data container, typically due to an unexpected shutdown, storage-level corruption, or an antivirus/backup tool interfering with the filestream.hdr or log files while SQL Server had them open. It can also happen if the underlying NTFS volume experienced a crash-consistent (not application-consistent) snapshot, leaving the RFS (Remote Filestream Store) log chain with a gap at the referenced LSN. Because FILESTREAM relies on a tightly coupled relationship between the SQL Server transaction log and the NTFS-based file system log, any mismatch at that LSN renders the log folder structure unrecoverable through normal crash recovery.

Step-by-Step Resolution Guide

Step 1: Confirm the Scope of Corruption

  • Check SQL Server Error Log and Windows Event Viewer (Application log) for Event ID 5533 and related FILESTREAM errors (5534, 5535) around the same timestamp.
  • Run DBCC CHECKDB (YourDatabaseName) WITH ALL_ERRORMSGS, NO_INFOMSGS; to determine if corruption extends beyond the FILESTREAM container.
  • Identify the exact FILESTREAM data container path via SELECT name, physical_name FROM sys.database_files WHERE type_desc = 'FILESTREAM';.

Step 2: Take the Database Offline and Isolate the Log Folder

  • Set the database to single-user or offline mode: ALTER DATABASE YourDatabaseName SET OFFLINE WITH ROLLBACK IMMEDIATE;
  • Navigate to the FILESTREAM container path (e.g., D:\SQLData\FileStreamData\) and locate the $FSLOG folder.
  • Do not attempt to manually edit or delete files inside $FSLOG; this folder is a hidden system structure and manual changes will worsen corruption.

Step 3: Restore the Database from a Known-Good Backup

  • Identify your most recent full backup and subsequent log/differential backups using RESTORE HEADERONLY FROM DISK = 'D:\Backups\YourDatabase.bak';.
  • Restore the full backup first: RESTORE DATABASE YourDatabaseName FROM DISK = 'D:\Backups\YourDatabase.bak' WITH NORECOVERY;
  • Apply subsequent transaction log backups in sequence, then finish with RESTORE DATABASE YourDatabaseName WITH RECOVERY; to bring the FILESTREAM log folder back into a consistent state.

Step 4: Rebuild the FILESTREAM Filegroup (If No Valid Backup Exists)

  • If no backup exists, remove the corrupted FILESTREAM filegroup: ALTER DATABASE YourDatabaseName REMOVE FILE YourFilestreamLogicalName;
  • Create a new FILESTREAM filegroup and file pointing to a fresh folder path, then re-import FILESTREAM data from any available export or application-side cache.
  • Re-enable FILESTREAM access at the instance level via SQL Server Configuration Manager if it was reset during cleanup.

Alternative or Verification Steps

  • After restore, run DBCC CHECKDB (YourDatabaseName) WITH ALL_ERRORMSGS; and query a sample of FILESTREAM columns (e.g., SELECT TOP 10 * FROM YourTable WHERE FilestreamColumn IS NOT NULL;) to confirm data accessibility.
  • If restoring is not possible and the filegroup must be rebuilt, consider enabling the FILESTREAM and FileTable features fresh and validating with a test insert/retrieve cycle before reintroducing production data.

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

Troubleshooting Guide: Error 5534 – SQL Log Record Corruption in SQL Server 2025

Why This Error Happens

Error 5534 occurs when SQL Server encounters a damaged or unreadable log record at a specific Log Sequence Number (LSN) during the database recovery process, preventing the transaction log from being replayed correctly. This is typically caused by underlying storage corruption, abrupt power loss or improper shutdown during an active write operation, faulty disk sectors, or interference from antivirus/backup software locking the log file mid-write. In rare cases, it can also result from a bug in a specific build interacting with Instant File Initialization or compressed/encrypted volumes hosting the LDF file.

Step-by-Step Resolution Guide

Step 1: Isolate the Database and Assess Damage

  • Take the database offline immediately to prevent further write attempts: ALTER DATABASE [YourDB] SET OFFLINE WITH ROLLBACK IMMEDIATE;
  • Check the SQL Server Error Log and Windows Event Viewer (Application log) for correlating disk I/O errors (Event ID 7, 9, or 51) around the timestamp of the corruption.
  • Run CHKDSK E: /F /R (replace E: with the actual drive letter hosting the .ldf file) to rule out physical disk-level sector errors.

Step 2: Attempt Emergency Mode Repair

  • Set the database into Emergency Mode to allow limited read access: ALTER DATABASE [YourDB] SET EMERGENCY;
  • Run a consistency check to confirm the scope of the corruption: DBCC CHECKDB ('YourDB') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If the log is unreadable, rebuild it (this breaks the log chain, so a full backup is required immediately after): ALTER DATABASE [YourDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE; DBCC CHECKDB ('YourDB', REPAIR_ALLOW_DATA_LOSS);

Step 3: Restore from a Verified Backup

  • If REPAIR_ALLOW_DATA_LOSS fails or data integrity is a priority, restore the last known good .bak file using SSMS 21 or T-SQL: RESTORE DATABASE [YourDB] FROM DISK = 'C:\Backups\YourDB.bak' WITH NORECOVERY;
  • Apply subsequent transaction log backups (.trn) sequentially up to the point just before the corruption occurred, using WITH STOPBEFOREMARK if you know the specific transaction.
  • Bring the database online: RESTORE DATABASE [YourDB] WITH RECOVERY;

Step 4: Harden the Environment to Prevent Recurrence

  • Move the transaction log file to a dedicated, non-compressed, non-deduplicated NTFS or ReFS volume separate from the data files.
  • Configure Windows Defender or third-party antivirus to exclude the *.mdf, *.ndf, and *.ldf file extensions from real-time scanning.
  • Verify that the storage controller’s write-caching policy is set to “Write Through” rather than “Write Back” unless a battery-backed cache is confirmed functional.

Alternative or Verification Steps

  • Verify the Fix: Run DBCC CHECKDB ('YourDB') WITH NO_INFOMSGS; and DBCC SQLPERF(LOGSPACE); to confirm zero allocation errors and normal log growth behavior post-recovery.
  • Alternative: If no backups exist and REPAIR_ALLOW_DATA_LOSS does not resolve the LSN corruption, extract salvageable data into a new database using sp_copy_data or linked server queries before dropping the original corrupted database file.

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

Why This Error Happens

Error 5528 occurs because SQL Server enforces a strict architectural rule: a single database can only have one FILESTREAM filegroup marked as “CONTAINS FILESTREAM” with the log property enabled, and only one file within that filegroup. This typically happens when a developer or DBA attempts to run a CREATE DATABASE or ALTER DATABASE script that mistakenly defines a second FILESTREAM filegroup, or when a migration script copies filegroup definitions without checking for existing FILESTREAM configurations. It can also surface during database restore operations where the source and destination databases have conflicting FILESTREAM filegroup structures.

Step-by-Step Resolution Guide

Step 1: Identify the Existing FILESTREAM Filegroup

  • Open SQL Server Management Studio (SSMS) and connect to your Windows Server 2025 instance.
  • Run the following query to list current filegroups:
SELECT name, type_desc, is_default 
FROM sys.filegroups 
WHERE type = 'FD';
  • Note the name of the existing FILESTREAM filegroup (type_desc will show FILESTREAM_DATA).

Step 2: Review and Correct the T-SQL Script

  • Open the script that triggered the error (often a CREATE DATABASE or ALTER DATABASE ADD FILEGROUP statement).
  • Remove any duplicate CONTAINS FILESTREAM filegroup definitions — only one should exist per database.
  • If you need an additional location for FILESTREAM data, add a new file to the existing filegroup instead of creating a new filegroup:
ALTER DATABASE YourDB 
ADD FILE (
    NAME = FileStreamData2, 
    FILENAME = 'C:\SQLData\FileStreamData2'
) TO FILEGROUP FileStreamGroup1;

Step 3: Clean Up Conflicting Filegroups (If Already Created)

  • If the second filegroup was already partially created before the error halted execution, check for orphaned entries:
SELECT * FROM sys.filegroups WHERE type = 'FD';
  • If a duplicate exists and is empty, remove it:
ALTER DATABASE YourDB REMOVE FILEGROUP DuplicateFileStreamGroup;
  • Ensure no file paths overlap with existing FILESTREAM directories on disk (check under C:\SQLData\ or your configured path).

Step 4: Restart SQL Server Service (If Changes Were Made to Configuration)

  • Open Services.msc on Windows Server 2025 / Windows 11.
  • Locate SQL Server (MSSQLSERVER) or your named instance.
  • Right-click and select Restart to ensure FILESTREAM configuration changes are fully applied.

Alternative or Verification Steps

  • Re-run the original CREATE DATABASE or ALTER DATABASE script after cleanup; it should complete without Error 5528.
  • Verify FILESTREAM integrity by querying sys.database_files and confirming only one row has type_desc = 'FILESTREAM' acting as the log/data container for that filegroup.

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

Troubleshooting Guide: SQL Server Error 5529 – FILESTREAM File Removal Failure in Availability Groups

Why This Error Happens

This error occurs because SQL Server 2025 enforces synchronization guarantees for FILESTREAM data in Always On Availability Groups, preventing a DROP FILE operation until all secondary replicas confirm they have hardened (written to disk) the corresponding FILESTREAM data. If one or more secondary replicas are lagging, offline, disconnected, or stuck in a non-synchronized state, the primary database cannot verify that the file removal is safe to propagate. This is typically caused by slow network throughput between replicas, a secondary replica in a RESOLVING or NOT SYNCHRONIZING state, or large unprocessed FILESTREAM data in the log queue.

Step-by-Step Resolution Guide

Step 1: Verify the Availability Group Health State

  • Open SQL Server Management Studio (SSMS) and connect to the primary replica.
  • Run SELECT * FROM sys.dm_hadr_availability_replica_states; to check the synchronization_state_desc column for all replicas.
  • Confirm every secondary replica shows SYNCHRONIZED or SYNCHRONIZING and not NOT SYNCHRONIZING.

Step 2: Check FILESTREAM Hardening Progress on Secondary Replicas

  • On each secondary replica, run SELECT * FROM sys.dm_io_pending_io_requests; to identify pending I/O on the FILESTREAM filegroup volume.
  • Inspect the physical FILESTREAM container path (commonly D:\SQLData\FileStreamData\) to ensure the Windows Server 2025 storage subsystem is not reporting disk latency via Performance Monitor (Avg. Disk sec/Write counter).
  • Resolve any underlying storage bottlenecks, such as upgrading from spinning disk to NVMe/SSD-backed storage pools.

Step 3: Resynchronize the Lagging Secondary Replica

  • In SSMS, right-click the Availability Group in Object Explorer and select Show Dashboard to pinpoint which replica is behind.
  • If a replica is stalled, manually remove and re-add it using:
ALTER AVAILABILITY GROUP [YourAGName] REMOVE REPLICA ON N'SecondaryReplicaName';
  • Re-add the replica through the Add Replica Wizard, ensuring the Automatic Seeding option is enabled for faster FILESTREAM data transfer.

Step 4: Retry the DROP FILE Operation

  • Once all replicas report SYNCHRONIZED, re-run the original command, for example:
ALTER DATABASE [YourDatabase] REMOVE FILE [FileStreamLogicalName];
  • Monitor the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for confirmation that the file was dropped without error 5529 recurring.

Alternative or Verification Steps

  • Verify success by querying sys.master_files on both the primary and all secondary replicas to confirm the FILESTREAM file entry no longer exists on any node.
  • If the issue persists under heavy load, temporarily fail over the Availability Group to a healthy secondary, perform the DROP FILE operation while that node acts as primary, then fail back once replication stabilizes.

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

Troubleshooting Guide: SQL Server Error 5531

Why This Error Happens

Error 5531 occurs when SQL Server’s Transaction File System Resource Manager (TxF/CLFS) fails to switch its logging mode (typically between “full” and “undo” logging) on the underlying volume. This is most commonly caused by the SQL Server service account lacking sufficient NTFS/CLFS permissions on the log directory, the Common Log File System (CLFS) driver being disabled or corrupted on Windows Server 2025/Windows 11, or the target volume not supporting Transactional NTFS (TxF) features due to filesystem configuration or third-party filter drivers (antivirus/backup software) interfering with the log stream. In some cases, the resource manager container file itself (the .blf log file) may be corrupted or locked by another process.

Step-by-Step Resolution Guide

Step 1: Verify CLFS Driver and Service Status

  • Open an elevated PowerShell/Command Prompt and run sc query clfs to confirm the Common Log File System driver is present and running.
  • If stopped or disabled, run sc config clfs start=auto followed by sc start clfs.
  • Check Event Viewer under Windows Logs > System for any CLFS-related driver load failures.

Step 2: Validate NTFS Permissions on the Resource Manager Path

  • Navigate to the path referenced in the error message (e.g., C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\).
  • Right-click the folder, go to Properties > Security, and ensure the SQL Server service account (e.g., NT SERVICE\MSSQLSERVER) has Full Control.
  • Apply permissions recursively using icacls "C:\Path\To\Data" /grant "NT SERVICE\MSSQLSERVER:(OI)(CI)F" /T.

Step 3: Check for Filter Driver or Antivirus Interference

  • Temporarily disable real-time antivirus/backup agent filters (e.g., via fltmc filters to list and fltmc unload <FilterName> to remove a suspect filter).
  • Add exclusions in your antivirus console for the SQL Server data and log directories.
  • Restart the SQL Server service and reproduce the operation that triggered Error 5531.

Step 4: Rebuild or Remove the Corrupted Resource Manager Log File

  • Stop the SQL Server service via net stop MSSQLSERVER.
  • Locate the .blf (base log file) and associated container files in the TxF resource manager path named in the error.
  • Rename or move the corrupted .blf files to a backup folder, then restart SQL Server to force regeneration: net start MSSQLSERVER.

Step 5: Confirm Volume Supports Transactional NTFS Features

  • Run fsutil resource info "C:" to validate the volume’s Transactional NTFS resource manager status.
  • If TxF is deprecated/unsupported on that specific volume (common on ReFS or certain Storage Spaces configurations), move the SQL Server data/log files to a standard NTFS volume.
  • Update storage configuration using SQL Server Configuration Manager to point to the new NTFS path.

Alternative or Verification Steps

  • Verify the fix by checking SQL Server Error Log (via EXEC sp_readerrorlog) for the absence of Error 5531 after restarting the service and running a transaction that previously triggered the failure.
  • If the issue persists, run DBCC CHECKDB on the affected database to rule out underlying corruption, and consider restoring from a known-good backup if the resource manager remains unstable.

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

Troubleshooting Guide: Error 5525 – FILESTREAM Log Filegroup READONLY/READWRITE Property Cannot Be Modified

Applies to: Microsoft SQL Server 2025 | Windows Server 2025 / Windows 11


Why This Error Happens

Error 5525 occurs because SQL Server does not allow the READONLY or READWRITE property to be explicitly set on a filegroup that has been designated as the FILESTREAM log filegroup. This filegroup is internally managed by the Database Engine to track FILESTREAM data operations, and its read/write state is tied directly to the state of the PRIMARY filegroup and the database itself rather than being independently configurable. Attempting to run ALTER DATABASE ... MODIFY FILEGROUP directly against this special filegroup triggers the error because the engine blocks manual state changes to protect transactional consistency of FILESTREAM data.


Step-by-Step Resolution Guide

Step 1: Identify the FILESTREAM Filegroup in Question

  • Run the following query to confirm which filegroup is marked as the FILESTREAM log/data filegroup:
  SELECT name, type_desc, is_default, is_read_only 
  FROM sys.filegroups;
  • Confirm the type_desc returns FILESTREAM_DATA_FILEGROUP — this confirms you are targeting a restricted filegroup.

Step 2: Change the Read/Write State at the Database Level Instead

  • Do not attempt to modify the individual FILESTREAM filegroup directly.
  • Instead, set the read-only state at the full database level, which will cascade correctly to FILESTREAM containers:
  ALTER DATABASE [YourDatabaseName] SET READ_ONLY;
  • To revert, use:
  ALTER DATABASE [YourDatabaseName] SET READ_WRITE;

Step 3: Verify No Active Connections Are Blocking the Change

  • Ensure no open transactions or active sessions are using FILESTREAM data, as this can cause the ALTER DATABASE command to hang or fail silently.
  • Run:
  SELECT session_id, status, last_request_start_time 
  FROM sys.dm_exec_sessions 
  WHERE database_id = DB_ID('YourDatabaseName');
  • Kill blocking sessions if necessary using KILL <session_id>.

Step 4: Restart the SQL Server FILESTREAM Service (If State Remains Stuck)

  • Open Services.msc on Windows Server 2025 / Windows 11.
  • Restart the SQL Server (MSSQLSERVER) service to force FILESTREAM subsystem re-initialization.
  • Re-run the ALTER DATABASE command from Step 2 after the service comes back online.

Alternative or Verification Steps

  • Verify the fix by re-querying sys.databases and checking the is_read_only column matches your intended state (1 for read-only, 0 for read-write).
  • If the database still refuses to change state, detach and re-attach the database, then reapply the ALTER DATABASE command, as a stale metadata cache on the FILESTREAM container can sometimes cause Error 5525 to persist.

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

Troubleshooting Guide: SQL Server Error 5526 — FILESTREAM Log File Removal Conflict

Why This Error Happens

This error occurs when an attempt is made to remove a FILESTREAM log file while an active FILESTREAM data filegroup still references it. SQL Server 2025 maintains a dependency link between the FILESTREAM transaction log metadata and its associated data filegroup to ensure transactional consistency for BLOB data stored outside the primary database files. Until the filegroup itself is dropped or the dependent files are reassigned, the storage engine blocks removal of the log file to prevent orphaned references and potential data corruption.

Step-by-Step Resolution Guide

Step 1: Identify the Dependent Filegroup

  • Run the following query to list FILESTREAM filegroups and their associated files:
  SELECT fg.name AS FilegroupName, f.name AS FileName, f.physical_name
  FROM sys.filegroups fg
  JOIN sys.database_files f ON fg.data_space_id = f.data_space_id
  WHERE fg.type = 'FD';
  • Note the exact filegroup name tied to the FILESTREAM log file mentioned in the error message.

Step 2: Remove Data Files from the Filegroup First

  • Before dropping the log file, remove any data files still assigned to the FILESTREAM filegroup:
  ALTER DATABASE [YourDatabase]
  REMOVE FILE [FILESTREAM_DataFile_Name];
  • Confirm no active FILESTREAM data remains referenced in sys.database_files.

Step 3: Drop the FILESTREAM Filegroup

  • Once all data files are removed, drop the filegroup itself:
  ALTER DATABASE [YourDatabase]
  REMOVE FILEGROUP [FILESTREAM_Filegroup_Name];
  • This severs the dependency link that was blocking log file removal.

Step 4: Remove the FILESTREAM Log File

  • Now attempt to remove the log file safely:
  ALTER DATABASE [YourDatabase]
  REMOVE FILE [FILESTREAM_LogFile_Name];
  • Verify Windows Server 2025 file permissions on the FILESTREAM directory (typically under C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\FILESTREAM\) are not locking the file via antivirus or backup agents.

Step 5: Restart SQL Server Service (If Needed)

  • If the file remains locked, restart the SQL Server service via Services.msc or PowerShell:
  Restart-Service -Name 'MSSQLSERVER' -Force
  • This clears any cached file handles tied to the old FILESTREAM configuration.

Alternative or Verification Steps

  • Verify success by re-running the sys.database_files query — the FILESTREAM log file and filegroup should no longer appear.
  • If removal still fails, check Event Viewer (Windows Logs → Application) for Event ID 5526 recurrence, and ensure no open transactions or replication/Change Data Capture jobs are still referencing the FILESTREAM filegroup.

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

Troubleshooting Guide: Error 5527 – Cannot Drop Primary FILESTREAM Filegroup

Why This Error Happens

Error 5527 occurs because SQL Server 2025 enforces a strict filegroup hierarchy for FILESTREAM data, requiring the primary FILESTREAM filegroup to remain intact as long as any secondary FILESTREAM filegroups are attached to the database. Attempting to drop the primary filegroup while other FILESTREAM filegroups still reference it violates this dependency chain, causing SQL Server to block the operation to prevent orphaned data pointers. This typically happens when a DBA attempts cleanup or filegroup reorganization without first removing all child FILESTREAM filegroups in the correct sequence.

Step-by-Step Resolution Guide

Step 1: Identify All Existing FILESTREAM Filegroups

  • Open SQL Server Management Studio (SSMS) connected to your SQL Server 2025 instance.
  • Run the following query to list all filegroups and their types:
SELECT name, type_desc, is_default 
FROM sys.filegroups 
WHERE type = 'FD';
  • Note the names of every FILESTREAM filegroup, including the primary one you’re trying to drop.

Step 2: Remove Files from Secondary FILESTREAM Filegroups

  • Before dropping any filegroup, you must first remove the actual file containers associated with secondary FILESTREAM filegroups.
  • Use ALTER DATABASE to remove the file first:
ALTER DATABASE [YourDatabaseName] 
REMOVE FILE [SecondaryFileStreamFileName];
  • Repeat this for every file within each non-primary FILESTREAM filegroup.

Step 3: Drop Secondary FILESTREAM Filegroups in Order

  • Once files are removed, drop the empty secondary filegroups one by one:
ALTER DATABASE [YourDatabaseName] 
REMOVE FILEGROUP [SecondaryFileStreamGroupName];
  • Repeat until only the primary FILESTREAM filegroup remains.
  • Check C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\ (or your configured FILESTREAM data path) to confirm the corresponding directories have been physically cleared by SQL Server.

Step 4: Drop the Primary FILESTREAM Filegroup

  • With all secondary filegroups removed, now attempt to drop the primary filegroup:
ALTER DATABASE [YourDatabaseName] 
REMOVE FILEGROUP [PrimaryFileStreamGroupName];
  • Confirm no error 5527 is returned in the Messages pane.

Step 5: Restart SQL Server FILESTREAM Service (If Needed)

  • If the error persists due to cached metadata, restart the FILESTREAM-related service via PowerShell (Run as Administrator):
Restart-Service -Name 'MSSQLSERVER' -Force
  • On Windows Server 2025/Windows 11, also verify FILESTREAM is still enabled correctly via SQL Server Configuration Manager under the FILESTREAM tab.

Alternative or Verification Steps

  • Re-run SELECT * FROM sys.filegroups WHERE type = 'FD'; after completing the steps — only filegroups you intend to keep should appear in the results.
  • If the primary filegroup still cannot be dropped, consider detaching and reattaching the database (sp_detach_db / CREATE DATABASE ... FOR ATTACH) to force SQL Server to rebuild its internal filegroup dependency map.

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

Troubleshooting Guide: SQL Server Error 5522 (FILESTREAM Data File Removal Failure)

Why This Error Happens

Error 5522 occurs when SQL Server 2025 attempts to remove a FILESTREAM data file or filegroup while the associated transaction log still contains inactive log records that have not been captured by a log backup. Because FILESTREAM operations are logged similarly to standard data modifications, SQL Server enforces a rule that prevents file removal until the log is truncated via a proper backup, ensuring the database remains in a recoverable and consistent state. This typically happens on databases using the FULL or BULK_LOGGED recovery model where scheduled log backups have been missed, disabled, or misconfigured.

Step-by-Step Resolution Guide

Step 1: Verify the Database Recovery Model and Log Status

  • Open SQL Server Management Studio (SSMS) and connect to your SQL Server 2025 instance.
  • Run the following query to check the recovery model and log reuse wait description:
SELECT name, recovery_model_desc, log_reuse_wait_desc 
FROM sys.databases 
WHERE name = 'YourDatabaseName';
  • If log_reuse_wait_desc shows LOG_BACKUP, this confirms the root cause.

Step 2: Perform a Transaction Log Backup

  • Execute a log backup to clear the inactive portion of the log and allow truncation:
BACKUP LOG [YourDatabaseName] 
TO DISK = 'C:\SQLBackups\YourDatabaseName_Log.trn';
  • Ensure the backup destination folder exists on the Windows Server 2025 host and that the SQL Server service account has write permissions to C:\SQLBackups\.
  • If no full backup exists yet, run a full database backup first before attempting the log backup.

Step 3: Retry the FILESTREAM File Removal

  • After the log backup completes successfully, re-attempt the original command to remove the FILESTREAM file:
ALTER DATABASE [YourDatabaseName] 
REMOVE FILE [YourFileStreamLogicalName];
  • Confirm there are no open transactions or active sessions referencing the FILESTREAM filegroup using:
SELECT * FROM sys.dm_tran_active_transactions;

Step 4: Configure Scheduled Log Backups to Prevent Recurrence

  • Open SQL Server Management Studio → SQL Server Agent → Jobs.
  • Create or verify a maintenance plan that runs transaction log backups at regular intervals (e.g., every 15–30 minutes).
  • Alternatively, use Ola Hallengren’s Maintenance Solution scripts for automated log backup scheduling on Windows Server 2025 environments.

Alternative or Verification Steps

  • Verify the fix by re-running the log_reuse_wait_desc query from Step 1 — it should now return NOTHING instead of LOG_BACKUP.
  • If log backups are not required for your environment (e.g., test/dev systems), switch the database to the SIMPLE recovery model using ALTER DATABASE [YourDatabaseName] SET RECOVERY SIMPLE; to bypass the log backup requirement entirely before removing the FILESTREAM file.

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

Why This Error Happens

This error occurs because SQL Server requires a valid, non-empty FILESTREAM log file group before a data file group can reference it. Typically, the FILESTREAM log file group was created but never had an actual log file added to it, leaving it in an “empty” state that SQL Server rejects as a valid parent object. This often happens when database creation scripts are run out of sequence or when a migration script omits the file-group-to-file mapping step.

Step-by-Step Resolution Guide

Step 1: Verify the Current File Group Structure

  • Open SQL Server Management Studio (SSMS) and connect to your SQL Server 2025 instance.
  • Run the following query to inspect existing file groups:
  SELECT name, type_desc, is_default FROM sys.filegroups;
  • Confirm whether your FILESTREAM log file group (e.g., FileStreamLogGroup) has zero files associated with it.

Step 2: Add a Physical File to the Empty Log File Group

  • Use ALTER DATABASE to add an actual file to the empty FILESTREAM file group before referencing it:
  ALTER DATABASE [YourDatabase]
  ADD FILE (
      NAME = N'FileStreamLog',
      FILENAME = N'C:\SQLData\FileStreamLog'
  ) TO FILEGROUP [FileStreamLogGroup];
  • Ensure the target directory (e.g., C:\SQLData\) exists and is empty, since FILESTREAM requires an unused folder for its container.
  • On Windows Server 2025 / Windows 11, confirm the SQL Server service account has Full Control NTFS permissions on this folder via Properties > Security.

Step 3: Enable FILESTREAM at the Instance Level

  • Open SQL Server Configuration Manager, right-click your SQL Server instance, and select Properties.
  • Under the FILESTREAM tab, ensure “Enable FILESTREAM for Transact-SQL access” is checked.
  • Restart the SQL Server service for changes to take effect:
  Restart-Service -Name 'MSSQLSERVER'

Step 4: Re-Attempt Adding the Data File Group

  • Once the log file group has a valid file, re-run your original command to add the data file group:
  ALTER DATABASE [YourDatabase]
  ADD FILEGROUP [FileStreamDataGroup] CONTAINS FILESTREAM;
  • Confirm there are no residual locks or open transactions on the database using sp_who2 before executing.

Alternative or Verification Steps

  • Run SELECT * FROM sys.database_files; to confirm the new FILESTREAM log file now appears with a valid physical_name and is mapped to the correct file group ID.
  • If the error persists, drop and recreate the FILESTREAM file group entirely, ensuring you add the file immediately after creating the group in the same transaction batch to avoid an empty-group state.

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

Troubleshooting Guide: SQL Server Error 5524 — Default FILESTREAM Filegroup Cannot Be Removed

Why This Error Happens

Error 5524 occurs because SQL Server 2025 requires at least one FILESTREAM data filegroup to exist in the database as long as the database is marked as using FILESTREAM storage. When you attempt to drop or alter the default FILESTREAM filegroup while it is the only one remaining, SQL Server blocks the operation to prevent orphaning FILESTREAM data that may still be referenced by table columns or metadata. This typically happens when administrators try to reorganize storage topology without first migrating or removing dependent FILESTREAM objects.

Step-by-Step Resolution Guide

Step 1: Verify FILESTREAM Dependencies

  • Open SQL Server Management Studio (SSMS) and connect to the instance running on Windows Server 2025 or Windows 11.
  • Run the following query to check for tables using FILESTREAM columns:
  SELECT t.name AS TableName, c.name AS ColumnName
  FROM sys.tables t
  JOIN sys.columns c ON t.object_id = c.object_id
  WHERE c.is_filestream = 1;
  • If results are returned, you must remove or migrate these columns before the filegroup can be dropped.

Step 2: Create a New FILESTREAM Filegroup (If Needed)

  • If your goal is to reorganize storage rather than eliminate FILESTREAM entirely, add a new filegroup first:
  ALTER DATABASE [YourDB]
  ADD FILEGROUP FileStreamGroup2 CONTAINS FILESTREAM;
  • Add a file to the new filegroup pointing to a valid path, e.g., D:\SQLData\FileStreamData2.
  • Migrate any FILESTREAM data to the new filegroup using ALTER TABLE ... SWITCH or by rebuilding affected tables.

Step 3: Remove FILESTREAM Column References

  • Drop or alter any columns still referencing the default FILESTREAM filegroup:
  ALTER TABLE dbo.YourTable
  DROP COLUMN YourFileStreamColumn;
  • Confirm no FILETABLE objects exist that depend on the filegroup by querying sys.filetables.

Step 4: Drop the Original Default Filegroup

  • Once all dependencies are cleared and a secondary filegroup exists, remove the original default filegroup:
  ALTER DATABASE [YourDB]
  REMOVE FILEGROUP FileStreamGroupOriginal;
  • Ensure this is not flagged as the “last” FILESTREAM filegroup before execution, or the 5524 error will persist.

Step 5: Restart SQL Server Service

  • Open Services.msc on Windows Server 2025/Windows 11.
  • Restart the SQL Server (MSSQLSERVER) service to clear cached metadata locks related to FILESTREAM configuration.

Alternative or Verification Steps

  • Verify the fix by running sys.filegroups and confirming the old filegroup no longer appears in the result set while FILESTREAM functionality remains intact on the new filegroup.
  • If the error persists, back up the database, drop FILESTREAM entirely via ALTER DATABASE ... REMOVE FILESTREAM, and reconfigure it from scratch using a single, clean filegroup definition.

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

Troubleshooting Guide: Error 5519 — Missing Primary FILESTREAM Log Filegroup

Why This Error Happens

This error occurs because SQL Server 2025 requires a database to have a designated primary FILESTREAM filegroup (marked with CONTAINS FILESTREAM) along with an associated log file before any additional, non-primary FILESTREAM filegroups can be added. When administrators attempt to create secondary FILESTREAM filegroups without first establishing this primary structure, the database engine rejects the operation because there is no valid storage container to reference metadata and transaction logging for the FILESTREAM data. Essentially, the database schema is attempting to build a secondary structure on a foundation that does not yet exist.

Step-by-Step Resolution Guide

Step 1: Verify FILESTREAM is Enabled at the Instance Level

  • Open SQL Server Configuration Manager on Windows Server 2025 / Windows 11.
  • Navigate to SQL Server Services > right-click your instance > Properties > FILESTREAM tab.
  • Ensure “Enable FILESTREAM for Transact-SQL access” is checked.
  • Confirm via T-SQL:
  EXEC sp_configure 'filestream access level';
  • If the value is 0, run:
  EXEC sp_configure 'filestream access level', 2;
  RECONFIGURE;

Step 2: Create the Primary FILESTREAM Filegroup

  • Alter the target database to add a primary FILESTREAM filegroup before adding any others.
  • Run the following T-SQL, replacing YourDatabase with your actual database name:
  ALTER DATABASE YourDatabase
  ADD FILEGROUP FileStreamGroup1 CONTAINS FILESTREAM;
  • This filegroup must be marked as the primary FILESTREAM group—only one filegroup can hold this designation per database.

Step 3: Add the Required Log File to the Primary Filegroup

  • Associate a physical file/folder path with the primary FILESTREAM filegroup you just created.
  • Use a dedicated, empty directory (SQL Server creates the folder structure itself):
  ALTER DATABASE YourDatabase
  ADD FILE
  (
      NAME = FileStreamDoc1,
      FILENAME = 'C:\SQLData\FileStreamData\FileStreamGroup1'
  )
  TO FILEGROUP FileStreamGroup1;
  • Ensure the SQL Server service account has read/write permissions on the C:\SQLData\FileStreamData\ path.

Step 4: Add Secondary FILESTREAM Filegroups

  • Once the primary filegroup and file exist, you can now safely add additional FILESTREAM filegroups:
  ALTER DATABASE YourDatabase
  ADD FILEGROUP FileStreamGroup2 CONTAINS FILESTREAM;

  ALTER DATABASE YourDatabase
  ADD FILE
  (
      NAME = FileStreamDoc2,
      FILENAME = 'C:\SQLData\FileStreamData\FileStreamGroup2'
  )
  TO FILEGROUP FileStreamGroup2;
  • Confirm no path or filegroup naming conflicts exist before executing.

Alternative or Verification Steps

  • Verify successful configuration by querying sys.filegroups and sys.database_files:
  SELECT name, type_desc, is_default FROM sys.filegroups WHERE type = 'FD';
  • If the error persists, drop any partially created FILESTREAM filegroups via ALTER DATABASE ... REMOVE FILEGROUP, restart the SQL Server service, and repeat Steps 2–3 in strict order before attempting Step 4 again.

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

Troubleshooting Guide: Error 5520 – FILESTREAM Container Upgrade Failure

Why This Error Happens

Error 5520 occurs when SQL Server attempts to recalculate the size of a FILESTREAM container during a database upgrade and encounters inconsistencies between the FILESTREAM directory structure and the internal metadata tables. This typically stems from corrupted or missing filestream data files, orphaned files left behind by an improperly terminated previous operation, or insufficient NTFS permissions for the SQL Server service account on the FILESTREAM data container path. It can also surface when the underlying storage volume has unresolved disk errors or when antivirus/backup software has locked files inside the FILESTREAM container during the upgrade process.

Step-by-Step Resolution Guide

Step 1: Review the Full Error Log Context

  • Open SQL Server Configuration Manager or navigate to the log path (typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) and search for entries immediately preceding Error 5520.
  • Look for related errors such as 5901, 5903, or OS-level I/O errors (Event ID 823/824) that indicate the specific file or directory causing the recalculation failure.
  • Note the exact container ID and database ID referenced in the error to isolate the affected FILESTREAM filegroup.

Step 2: Verify NTFS Permissions and Service Account Access

  • Locate the FILESTREAM data container folder, usually under a path like D:\SQLData\FileStreamData\<GUID>.
  • Right-click the folder, go to Properties > Security, and confirm the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control.
  • Run the following PowerShell command to reset permissions if needed:
  icacls "D:\SQLData\FileStreamData" /grant "NT SERVICE\MSSQLSERVER:(OI)(CI)F" /T
  • Restart the SQL Server service after applying permission changes.

Step 3: Check for File-Level Corruption or Orphaned Files

  • Run DBCC CHECKDB with the DATA_PURITY option against the affected database to identify corruption:
  DBCC CHECKDB (YourDatabaseName) WITH DATA_PURITY;
  • Manually inspect the FILESTREAM container folder for orphaned .tmp or zero-byte files that do not correspond to any active LOB pointer in the sys.filestream_tombstone system view.
  • If orphaned files are found, back up the database first, then remove confirmed orphaned files only after validating they are not referenced by FILESTREAM_PENDING_DELETE operations.

Step 4: Disable Interfering Services and Retry the Upgrade

  • Temporarily exclude the FILESTREAM data directory from antivirus real-time scanning (common in Windows Defender via Virus & Threat Protection Settings > Exclusions).
  • Ensure no backup agent or VSS snapshot process is actively locking files in the container directory.
  • Re-run the database upgrade or ALTER DATABASE command that triggered the original FILESTREAM container upgrade.

Step 5: Rebuild the FILESTREAM Filegroup (If Corruption Persists)

  • If the container remains unrecoverable, create a new FILESTREAM filegroup and migrate data using INSERT INTO ... SELECT from the old filestream column to the new one.
  • Drop the corrupted filegroup only after confirming all data has been successfully migrated and verified.

Alternative or Verification Steps

  • Confirm resolution by restarting the SQL Server service and checking the ERRORLOG for successful FILESTREAM initialization messages (no further 5520 entries on startup).
  • If the issue persists after all steps, restore the database from the last known good backup taken prior to the upgrade attempt, then reapply the upgrade in a maintenance window with antivirus and VSS services fully disabled.

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

Troubleshooting Guide: SQL Server Error 5521 (Transaction File System Resource Manager Retrieval Failure)

Why This Error Happens

Error 5521 occurs when SQL Server 2025 attempts to communicate with the Kernel Transaction Manager (KTM) and the Transaction File System Resource Manager (TxF RM) on the underlying NTFS volume, but the operation fails with an NT status code. This typically happens because the TxF feature has been disabled at the volume or OS level, the resource manager metadata is corrupted, or the SQL Server service account lacks the necessary permissions to access the $Txf system directory. In some cases, this also surfaces after an in-place OS upgrade to Windows Server 2025 or Windows 11, where TxF support has been deprecated or restricted by default.

Step-by-Step Resolution Guide

Step 1: Verify TxF Status on the Target Volume

  • Open an elevated Command Prompt and run fsutil resource info C:\ (replace C:\ with the actual volume hosting your database files).
  • Confirm whether the output returns a valid Resource Manager GUID or an error indicating TxF is disabled.
  • If TxF is disabled, note that Microsoft has deprecated this feature in newer Windows builds, which directly correlates with Error 5521.

Step 2: Re-enable or Repair the Resource Manager

  • If TxF support is still required, run fsutil resource create C:\ to recreate the Resource Manager object on the volume.
  • Stop any processes using the volume, then attempt fsutil resource start C:\ to restart the TxF Resource Manager.
  • If the RM logs are corrupted, you may need to run fsutil resource recover C:\ to force a log recovery pass.

Step 3: Validate SQL Server Service Account Permissions

  • Navigate to the volume root and locate the hidden $Txf folder (requires enabling “Show hidden files” and “Show protected operating system files” in File Explorer options).
  • Right-click the SQL Server data/log directory (e.g., D:\SQLData\) and verify the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control at the NTFS level.
  • Apply permissions recursively and restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.

Step 4: Check for OS-Level TxF Deprecation

  • Since TxF is marked for removal in modern Windows builds, confirm via dism /online /get-features whether the “TxF” optional feature is present and enabled on Windows Server 2025.
  • If TxF is fully removed from your build, migrate any workloads relying on transacted file operations away from TxF-dependent configurations (e.g., certain legacy FILESTREAM or backup compression setups).

Step 5: Rebuild the Affected Database Files if Necessary

  • If the error persists only on specific database files, detach the database using sp_detach_db.
  • Move the physical .mdf/.ldf files to a volume with confirmed working TxF support (or no TxF dependency).
  • Reattach the database using sp_attach_db and monitor the SQL Server error log for recurrence of Error 5521.

Alternative or Verification Steps

  • To verify the fix, run fsutil resource info <Volume> again and confirm a clean status with no pending transactions, then check the SQL Server error log (ERRORLOG) for absence of Error 5521 after a full service restart.
  • If TxF cannot be restored on Windows Server 2025 due to deprecation, the recommended alternative is to migrate the database files to a volume configuration that doesn’t invoke TxF-dependent SQL Server features, as Microsoft advises against new dependencies on this legacy technology.

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

Troubleshooting Guide: Error 5516 – FILESTREAM Log Filegroup Referenced by Multiple Data Filegroups

Why This Error Happens

This error occurs because SQL Server 2025 enforces a strict one-to-one relationship between a FILESTREAM data filegroup and its associated log filegroup. It is typically triggered when a database creation or restore script mistakenly assigns the same FILESTREAM filegroup name to two different data filegroups, or when a database migration process duplicates filegroup metadata without updating the internal references. Corrupted system catalog views (such as sys.filegroups) following an improper backup restoration can also cause this conflict to surface.

Step-by-Step Resolution Guide

Step 1: Audit the Current Filegroup Structure

  • Open SQL Server Management Studio (SSMS) and connect to the instance running on Windows Server 2025.
  • Run the following query to inspect existing filegroups: SELECT name, type_desc, is_default FROM sys.filegroups;
  • Identify if two “FILESTREAM_DATA” type filegroups are pointing to the same log filegroup name.

Step 2: Correct the T-SQL Script or Restore Logic

  • Locate the CREATE DATABASE or ALTER DATABASE script responsible for the error.
  • Ensure every ADD FILEGROUP command for FILESTREAM data uses a unique, distinct name (e.g., FileStreamGroup1, FileStreamGroup2).
  • Verify that the CONTAINS FILESTREAM clause is not duplicated across multiple ADD FILEGROUP statements referencing the same log path.

Step 3: Drop and Recreate the Conflicting Filegroup

  • If the duplication already exists in a live database, run ALTER DATABASE [YourDB] REMOVE FILEGROUP [DuplicateGroupName]; to clear the conflict.
  • Re-create the filegroup with a unique identifier using ALTER DATABASE [YourDB] ADD FILEGROUP [UniqueFileStreamGroup] CONTAINS FILESTREAM;.
  • Restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER to clear any cached metadata locks.

Step 4: Validate File Paths in Windows Server 2025

  • Check the physical directory structure (e.g., C:\SQLData\FileStream\) to ensure no manual folder duplication is causing the engine to misread the filegroup association.
  • Confirm that NTFS permissions for the SQL Server service account allow unique write access to each specific FILESTREAM folder.

Alternative or Verification Steps

  • Verification: Re-run the sys.database_files query to confirm that the type_desc column shows FILESTREAM only once per unique filegroup pairing before attempting to bring the database online.
  • Alternative: If the error persists after script correction, detach the database, manually inspect the .mdf header using a hex editor for orphaned pointers, and perform a clean CREATE DATABASE followed by a data-only migration via BCP or SSIS to bypass the corrupted metadata entirely.

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

Troubleshooting Guide: Error 5517 – FILESTREAM Container MAXSIZE Must Be Greater Than or Equal to 512 KB

Why This Error Happens

This error occurs when attempting to create or alter a FILESTREAM filegroup with a MAXSIZE value set below the minimum threshold of 512 KB, which SQL Server 2025 enforces to ensure the container has sufficient space for metadata and initial file allocation. It commonly happens due to a typo in the size unit (e.g., specifying bytes instead of KB/MB) or when scripts are copied from older configurations without validating size parameters. Additionally, automated deployment scripts or DevOps pipelines that dynamically calculate storage sizes may pass a zero or near-zero value if a prior calculation step failed silently.

Step-by-Step Resolution Guide

Step 1: Review the T-SQL Script or Command Causing the Error

  • Locate the ALTER DATABASE or CREATE DATABASE statement containing the FILESTREAM filegroup definition.
  • Check the MAXSIZE parameter syntax, for example: MAXSIZE = 1024MB or MAXSIZE = UNLIMITED.
  • Verify no leading zeros, missing units, or decimal values are causing a silent rounding error below 512 KB.

Step 2: Correct the MAXSIZE Value

  • Update the script to explicitly set a value equal to or greater than 512 KB, such as:
  ALTER DATABASE [YourDB] 
  MODIFY FILE (NAME = FileStreamGroup1, MAXSIZE = 5120KB)
  • If the intention was unlimited growth, replace the clause with MAXSIZE = UNLIMITED instead of a hard-coded KB value.
  • Save the corrected script to C:\Scripts\SQL\FileStreamConfig.sql for version control purposes.

Step 3: Validate FILESTREAM Feature Configuration in SQL Server

  • Open SQL Server Configuration Manager on Windows Server 2025.
  • Navigate to SQL Server Services > right-click your instance > Properties > FILESTREAM tab.
  • Ensure “Enable FILESTREAM for Transact-SQL access” is checked, as a misconfigured feature can sometimes surface misleading size-related errors.

Step 4: Re-run the Database Creation or Alteration Script

  • Execute the updated script via SQL Server Management Studio (SSMS) or sqlcmd.
  • Example command line execution:
  sqlcmd -S localhost -i C:\Scripts\SQL\FileStreamConfig.sql
  • Confirm no Error 5517 appears in the Messages tab of SSMS output.

Step 5: Check Windows File System Permissions for the Container Path

  • Navigate to the FILESTREAM data folder (e.g., D:\SQLData\FileStreamContainer).
  • Right-click > Properties > Security tab, and confirm the SQL Server service account has Full Control.
  • Insufficient NTFS permissions can sometimes mask as size-allocation errors during container initialization.

Alternative or Verification Steps

  • Run sp_helpfile or query sys.database_files in SSMS to confirm the FILESTREAM filegroup now reflects the corrected MAXSIZE value.
  • If the error persists after correcting syntax, drop the FILESTREAM filegroup entirely and recreate it from scratch using a minimum safe value of MAXSIZE = 10240KB to rule out metadata corruption from the failed attempt.

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

Troubleshooting Guide: SQL Server Error 5518 — FILESTREAM Path Too Long

Why This Error Happens

Error 5518 occurs when the fully qualified FILESTREAM data container path exceeds the maximum path length supported by SQL Server, which is typically capped well below the Windows MAX_PATH (260 character) limit once internal subdirectory structures and GUID-based file names are appended. This commonly happens when a FILESTREAM filegroup is created inside a deeply nested folder structure, or when a database name, filegroup name, or logical file name is excessively long and gets concatenated into the physical directory path. It can also surface after migrating databases to Windows Server 2025 where backup/restore operations preserve an original long path structure from a different server environment.

Step-by-Step Resolution Guide

Step 1: Identify the Current FILESTREAM Path Length

  • Run the following query to locate the FILESTREAM-enabled filegroup and its root directory:
  SELECT name, physical_name FROM sys.master_files WHERE type_desc = 'FILESTREAM';
  • Manually count the character length of the path, including the database name folder and any GUID subfolders SQL Server will generate at runtime (these add roughly 40–50 characters).
  • Confirm whether the path exceeds 260 characters (standard) or approaches the ~32,000 character limit if long paths are enabled but still causing internal truncation issues.

Step 2: Shorten the Directory Structure

  • Move or recreate the FILESTREAM data container closer to the drive root, for example using D:\FSDATA\ instead of a nested path like D:\SQLServer\Databases\Production\FileStreamContainers\2025\.
  • Rename overly long database names, filegroup names, or logical file names, since SQL Server appends these directly into the physical FILESTREAM folder structure.
  • Use ALTER DATABASE to add a new FILESTREAM filegroup pointing to the shortened path:
  ALTER DATABASE YourDB ADD FILEGROUP FS_Filegroup CONTAINS FILESTREAM;
  ALTER DATABASE YourDB ADD FILE (NAME='FSData', FILENAME='D:\FSDATA\') TO FILEGROUP FS_Filegroup;

Step 3: Enable Long Path Support (If Shortening Isn’t Feasible)

  • Open Group Policy Editor (gpedit.msc) and navigate to Computer Configuration > Administrative Templates > System > Filesystem.
  • Enable “Enable Win32 long paths” and restart Windows Server 2025 or Windows 11 for the policy to take effect.
  • Alternatively, set the registry key directly:
  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
  LongPathsEnabled = 1 (DWORD)
  • Restart the SQL Server service afterward so it picks up the updated filesystem policy.

Step 4: Migrate Existing FILESTREAM Data

  • If the filegroup already contains data, create the new shortened-path filegroup first, then migrate BLOB data using UPDATE statements or INSERT INTO ... SELECT into tables mapped to the new filegroup.
  • Drop the old, overly long FILESTREAM filegroup only after confirming successful migration and application connectivity.
  • Validate file integrity using DBCC CHECKDB after the migration completes.

Alternative or Verification Steps

  • Verify the fix by inserting a new FILESTREAM BLOB record and confirming no Error 5518 appears in the SQL Server error log or Event Viewer (Event ID source: MSSQLSERVER).
  • If the error persists, check for antivirus or backup software intercepting the FILESTREAM container path, as some third-party agents reconstruct even longer UNC-style paths that re-trigger the limit.

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

Troubleshooting Guide: Error 5514 – Transactional File System Resource Manager Not Started

Why This Error Happens

Error 5514 occurs because SQL Server 2025’s Change Data Capture (CDC) and transactional replication features depend on the Transactional NTFS (TxF) Resource Manager to safely log and track changes at the file system level. This error surfaces when the TxF Resource Manager (RM) associated with the volume hosting your database files has not been initialized, is disabled by Windows Server 2025/Windows 11 group policy, or the underlying $Txf system metadata on that volume is corrupted or missing. Since Microsoft has deprecated TxF in recent Windows builds, it may also be disabled by default at the OS level, preventing SQL Server from starting the RM on demand.

Step-by-Step Resolution Guide

Step 1: Verify TxF is Enabled on the Target Volume

  • Open an elevated Command Prompt or PowerShell window.
  • Run fsutil resource info C:\ (replace C:\ with the actual drive hosting your SQL data/log files) to check the current Resource Manager state.
  • If you receive “Transactional NTFS is no longer supported” or a similar error, TxF has been disabled at the OS level for that volume.

Step 2: Re-enable Transactional NTFS via Registry and Group Policy

  • Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem in the Registry Editor.
  • Ensure the NtfsDisableTxfAndTops key is set to 0 (if present). If it is set to 1, change it to 0 and restart the server.
  • Alternatively, run gpedit.msc and navigate to Computer Configuration > Administrative Templates > System > Filesystem, then confirm “Enable Transactional NTFS” is not explicitly disabled.

Step 3: Manually Start or Rebuild the Resource Manager

  • Run fsutil resource start C:\ to attempt to manually start the RM on the affected volume.
  • If this fails due to corruption, run fsutil resource recover C:\ to attempt a log-based recovery of the TxF metadata.
  • As a last resort, back up the volume and run fsutil transaction list to identify and stop stale transactions, then reboot the server to force the RM to reinitialize.

Step 4: Validate SQL Server Service Account Permissions

  • Open Services.msc and confirm the SQL Server service account has “Full Control” NTFS permissions on the root of the volume hosting the database and log files.
  • Right-click the drive in File Explorer, go to Properties > Security, and add the SQL Server service account if it is missing.
  • Restart the SQL Server (MSSQLSERVER) service for permission changes to take effect.

Step 5: Migrate Database Files if TxF Remains Unsupported

  • If the volume is formatted with a very recent NTFS version or ReFS where TxF support has been fully removed, transactional replication/CDC will not function.
  • Use ALTER DATABASE [YourDB] MODIFY FILE to relocate the affected .mdf/.ldf files to a legacy NTFS-formatted volume that supports TxF.
  • Re-enable CDC using sys.sp_cdc_enable_db after the migration completes.

Alternative or Verification Steps

  • To verify the fix, re-run fsutil resource info <DriveLetter>: and confirm the output shows “Resource Manager is active” rather than a “not started” status, then retry enabling CDC with EXEC sys.sp_cdc_enable_db.
  • If TxF cannot be restored due to OS-level deprecation, consider switching to Native CDC via the SQL Server Transaction Log reader (bypassing TxF dependency) or migrate to Always On Availability Groups with log shipping as an alternative to classic transactional replication.