# Sql-server – set a filegroup of database offline,change the location of files and bring it online again

filegroupssql servert-sql

I found that we can only take filegroup offline through t-sql,but to bring that filegroup online we need to restore the whole database.

Use this option only when the file is corrupted and can be restored. A file set to OFFLINE can only be set online by restoring the file from backup. For more information about restoring a single file, see RESTORE (Transact-SQL).