How to bring offline filegroup to online status in sql 2012 RRS feed

  • Question

  • HI there,

    I have a database that has secondary file Testdb_file1.ndf residing on secondary filegroup FG1 which has few tables on it
    some how this filegroup has gone offline not able to access tables that are in this filegroup...

    how to bring this file on fg1 to online....

    alter database TestDB modify file (name = 'TestDB_File1', online)---this gives error


    Tuesday, April 23, 2019 9:27 AM

All replies

  • Hi srm_2010,

    From your description, could you please try to use below T-SQL to bring the file online.

    use master
    restore database databasename file='filename' with recovery

    By the way, you can use the below T-SQL to check the file state.

    use databasename
    select * from sys.database_files
    Hope this help you.

    Best regards,
    Cathy Ji

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to  MSDN Support, feel free to contact

    Wednesday, April 24, 2019 7:41 AM
  • sorry for delay in reply ..pls let me try ur solution...


    Thursday, May 9, 2019 6:53 AM