Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

SQL Server Error 1724: Filegroup Not FILESTREAM

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Error 1724 means SQL Server cannot use the filegroup you referenced because it is not a FILESTREAM filegroup. To fix it, create a filegroup that contains a FILESTREAM file, then attach or restore the FILESTREAM data into that filegroup instead of a regular one. If you are restoring a database that contains FILESTREAM data, the restore statement must map the FILESTREAM filegroup to a FILESTREAM filegroup on the target instance.

What You'll Need

  • SQL Server Management Studio (SSMS) or Azure Data Studio connected to the instance.
  • ALTER DATABASE permission (or sysadmin) on the target instance.
  • FILESTREAM enabled on the instance and a Windows share configured if you are using file sharing.
  • A backup file or script that references the filegroup in question.

Step-by-Step

  1. Confirm the error context. Look at the full error message. It usually appears during CREATE DATABASE, ALTER DATABASE, RESTORE, or a backup/restore operation. Note the filegroup name mentioned. This tells you which filegroup SQL Server thinks is not FILESTREAM.
  2. Check whether FILESTREAM is enabled on the instance. In SSMS, right-click the server name and choose Properties. Open the Advanced page and look for the Filestream Access Level setting. It should be Transact-SQL access enabled or Full access enabled. If it is Disabled, enable it and restart the SQL Server service. You can also run EXEC sp_configure 'filestream access level'; to check the current value.
  3. List the filegroups and their files. Run SELECT name, type_desc FROM sys.filegroups; and SELECT name, physical_name, type_desc FROM sys.database_files; on the database in question. A FILESTREAM filegroup has type_desc = 'FILESTREAM' and contains a file with type_desc = 'FILESTREAM'. A regular filegroup has type_desc = 'ROWS'.
  4. Create a FILESTREAM filegroup if none exists. Use ALTER DATABASE YourDB ADD FILEGROUP FileStreamGroup CONTAINS FILESTREAM; then add a file: ALTER DATABASE YourDB ADD FILE (NAME = FileStreamData, FILENAME = 'C:\SQLData\FileStreamData') TO FILEGROUP FileStreamGroup; The path must be a directory, not a file, and the SQL Server service account needs write access.
  5. If you are restoring, map the filegroup correctly. Use RESTORE DATABASE ... WITH MOVE to move the FILESTREAM file to a FILESTREAM filegroup on the target. For example: RESTORE DATABASE YourDB FROM DISK = 'C:\Backups\YourDB.bak' WITH MOVE 'FileStreamData' TO 'C:\SQLData\FileStreamData', MOVE 'YourDB' TO 'C:\SQLData\YourDB.mdf', MOVE 'YourDB_log' TO 'C:\SQLData\YourDB_log.ldf'; Make sure the target filegroup is FILESTREAM before running the restore.
  6. If you are attaching a database, verify the filegroup definitions in the script. When using CREATE DATABASE ... FOR ATTACH, the script must include the FILESTREAM filegroup and file. If the script was generated from a database that had FILESTREAM, it should already include it. If not, add the FILESTREAM filegroup manually before attaching.
  7. Re-run the original operation. After the filegroup is correctly defined as FILESTREAM, retry the CREATE, ALTER, or RESTORE statement. The error should no longer appear.

Common Mistakes

  • Adding a FILESTREAM file to a regular filegroup. FILESTREAM files can only be added to a filegroup created with CONTAINS FILESTREAM. Adding one to a ROWS filegroup produces error 1724.
  • Forgetting to enable FILESTREAM at the instance level. Even if the database has a FILESTREAM filegroup, the instance must have FILESTREAM enabled, or operations will fail.
  • Using the wrong path for the FILESTREAM file. The FILENAME must point to a directory that does not exist yet or is empty; SQL Server creates the underlying files. Pointing to an existing file causes errors.
  • Restoring without WITH MOVE. If the original file paths do not exist on the target server, the restore fails. Always use WITH MOVE when restoring to a different instance or path.
  • Assuming a filegroup is FILESTREAM because it contains a file with a .filestream extension. Check sys.filegroups.type_desc to be sure.

Tips

  • Use SELECT * FROM sys.filegroups WHERE type = 'FD'; to list FILESTREAM filegroups quickly.
  • Keep FILESTREAM data on a separate volume from regular database files for better performance and easier backup management.
  • When scripting a database that uses FILESTREAM, include the filegroup and file definitions in your source control scripts.
  • Test restore and attach operations on a non-production instance first.
  • Remember that FILESTREAM requires the SQL Server service account to have access to the share and folder.

Troubleshooting

If the error persists after creating a FILESTREAM filegroup, check the following:

  • Verify the filegroup name in the error matches the one you created. Typos or case differences can cause confusion.
  • Check that the FILESTREAM file was actually added to the filegroup. Run SELECT * FROM sys.database_files WHERE type_desc = 'FILESTREAM'; and confirm the filegroup name.
  • Ensure the instance is restarted after enabling FILESTREAM. Some settings require a service restart.
  • If restoring, confirm the backup contains FILESTREAM data. Use RESTORE FILELISTONLY FROM DISK = 'C:\Backups\YourDB.bak'; and look for a FileType of FILESTREAM.
  • Check permissions on the FILESTREAM directory. The SQL Server service account needs full control on the folder.
  • Look at the SQL Server error log for additional details. Sometimes a more specific error precedes 1724.

Frequently Asked Questions

What does error 1724 mean exactly?

It means SQL Server attempted to use a filegroup for FILESTREAM data, but that filegroup was not created with the CONTAINS FILESTREAM clause. Only filegroups explicitly marked as FILESTREAM can hold FILESTREAM files.

Can I convert a regular filegroup to a FILESTREAM filegroup?

No. You cannot alter an existing filegroup to become a FILESTREAM filegroup. You must create a new filegroup with CONTAINS FILESTREAM and add FILESTREAM files to it.

Why do I get this error during restore?

The backup contains FILESTREAM data, but the restore statement is trying to place that data into a filegroup that is not FILESTREAM on the target instance. Use WITH MOVE to direct the FILESTREAM file to a FILESTREAM filegroup.

Do I need to enable FILESTREAM on the instance before creating a FILESTREAM filegroup?

Yes. FILESTREAM must be enabled at the instance level (via sp_configure or SSMS) before you can create a FILESTREAM filegroup or add FILESTREAM files.

What if I don't have a FILESTREAM filegroup and don't need FILESTREAM?

If the database does not use FILESTREAM, you can ignore the error only if it is not blocking your operation. If it is blocking a restore, you may need to create a FILESTREAM filegroup to satisfy the restore, even if you later remove the FILESTREAM data.

Can I use a FILESTREAM filegroup for regular data?

No. FILESTREAM filegroups are only for FILESTREAM data. Regular data must reside in ROWS filegroups.