Troubleshooting Guide: SQL Server Error 5506 – FILESTREAM File Named ‘DEFAULT’
Why This Error Happens
This error occurs because DEFAULT is a reserved keyword used internally by SQL Server’s FILESTREAM filegroup logic to designate the active container for BLOB storage. When a script or GUI operation explicitly attempts to name a FILESTREAM data or log file “DEFAULT,” SQL Server 2025 rejects the DDL statement to avoid a naming collision with the engine’s internal pointer system. This typically happens during manual database creation scripts or when migrating legacy T-SQL code to a Windows Server 2025 environment without updating file naming conventions.
Step-by-Step Resolution Guide
Step 1: Review the T-SQL Creation Script
- Open SQL Server Management Studio (SSMS) and locate the
CREATE DATABASEorALTER DATABASEscript causing the failure. - Search specifically for the
ADD FILEclause within theFILESTREAMfilegroup definition. - Identify the exact line where
NAME = 'DEFAULT'is being declared.
Step 2: Rename the Logical File Identifier
- Change the logical name parameter from
DEFAULTto a unique, descriptive identifier (e.g.,FileStreamGroup1orDB_FS_Data). - Ensure the physical path points to a valid, empty directory on the NTFS volume, such as
C:\SQLData\FileStreamContainer. - Verify the syntax matches the following corrected format:
ALTER DATABASE [YourDB]
ADD FILE (NAME = 'FileStreamGroup1', FILENAME = 'C:\SQLData\FileStreamContainer')
TO FILEGROUP [FileStreamGroup]
Step 3: Validate Windows Server 2025 Permissions
- Confirm that the SQL Server service account has “Full Control” permissions on the parent folder via the Windows 11/Server 2025 Security tab.
- Check that the FILESTREAM feature is enabled in SQL Server Configuration Manager under the service properties.
- Restart the SQL Server (MSSQLSERVER) service to apply any configuration changes.
Step 4: Re-execute the Database Script
- Run the corrected script in a new query window in SSMS.
- Monitor the “Messages” tab for the “Command(s) completed successfully” confirmation, ensuring Error 5506 no longer triggers.
Alternative or Verification Steps
- Verification: Query the
sys.database_filescatalog view (SELECT name, physical_name FROM sys.database_files;) to confirm the new file name appears correctly without the reserved “DEFAULT” keyword. - Alternative: If the error persists due to cached metadata, drop the specific filegroup (if empty) and recreate it entirely using the
ALTER DATABASE... REMOVE FILEGROUPcommand before re-adding the file with the corrected name.