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 DATABASEorALTER DATABASE ADD FILEGROUPstatement). - Remove any duplicate
CONTAINS FILESTREAMfilegroup 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 DATABASEorALTER DATABASEscript after cleanup; it should complete without Error 5528. - Verify FILESTREAM integrity by querying
sys.database_filesand confirming only one row hastype_desc = 'FILESTREAM'acting as the log/data container for that filegroup.