Why This Error Happens
Error 12109 typically occurs when SQL Server 2025 cannot complete a FILESTREAM or FileTable operation because the underlying NTFS directory structure, share permissions, or the FILESTREAM filegroup is inaccessible. This usually stems from the SQL Server service account lacking NTFS “Full Control” rights on the FILESTREAM data container, the Windows share being disabled, or the FILESTREAM feature being only partially enabled at the instance level. It can also surface if the physical files backing the FileTable/FILESTREAM filegroup were moved, renamed, or corrupted outside of SQL Server’s control.
Step-by-Step Resolution Guide
Step 1: Verify FILESTREAM is Fully Enabled at the OS and Instance Level
- Open SQL Server Configuration Manager > right-click your instance (e.g.,
MSSQLSERVER) > Properties > FILESTREAM tab. - Confirm all three checkboxes are ticked: “Enable FILESTREAM for Transact-SQL access,” “Enable FILESTREAM for file I/O access,” and “Allow remote clients access to FILESTREAM data.”
- Run the following in SSMS to confirm instance-level configuration matches:
EXEC sp_configure 'filestream access level', 2;
RECONFIGURE;
- Restart the SQL Server service after making changes via
services.mscornet stop MSSQLSERVER && net start MSSQLSERVER.
Step 2: Check NTFS and Share Permissions on the FILESTREAM Directory
- Navigate to the physical path of your FILESTREAM filegroup (e.g.,
D:\SQLData\FileStreamData). - Right-click the folder > Properties > Security tab, and confirm the SQL Server service account (e.g.,
NT Service\MSSQLSERVER) has Full Control. - Validate the Windows share permissions by running:
Get-SmbShare | Where-Object {$_.Name -like "*MSSQLSERVER*"}
- If the share is missing or disabled, re-create it using
Set-SmbShareor re-run the FILESTREAM configuration wizard.
Step 3: Validate the Integrity of the FILESTREAM Filegroup and Container
- Run
DBCC CHECKDBwith the extended FILESTREAM data check to rule out corruption:
DBCC CHECKDB (YourDatabaseName) WITH DATA_PURITY, ALL_ERRORMSGS;
- If files were manually moved or deleted outside of SQL Server, restore the database from a known-good backup rather than attempting manual file repair.
- Confirm the filegroup path still matches what is registered in
sys.database_files:
SELECT name, physical_name FROM sys.database_files WHERE type_desc = 'FILESTREAM';
Step 4: Rebuild or Reassign the FileTable/FILESTREAM Container (If Needed)
- If the container is unrecoverable, drop and recreate the FileTable using:
ALTER TABLE YourFileTable DISABLE TRIGGER ALL;
DROP TABLE YourFileTable;
- Recreate the FileTable with a fresh
FILESTREAM_ONfilegroup pointing to a verified, permissioned directory. - Re-import files only after confirming the new path is stable and accessible.
Alternative or Verification Steps
- Re-run the original failing statement in SSMS and confirm no 12109 error appears; also check the SQL Server Error Log and Windows Event Viewer (Application log) for related FILESTREAM warnings.
- As a fallback, use
Process Monitor (ProcMon)filtered onsqlservr.exeto capture real-time “ACCESS DENIED” events against the FILESTREAM path, which pinpoints exact permission gaps faster than manual checks.