cannot remove empty file group

  • I have an empty file group, deleted/moved all the data in it. there is no data file left in it but still i cannot remove the file group.

    The filegroup 'FileGroupCommon' cannot be removed because it is not empty.

    when i check the partition scheme with the query below, it has no partition scheme id either.

    what should i do in that case? any oppinions?

    select partition_scheme_id,destination_id,a.data_space_id,name,b.data_space_id

    from sys.destination_data_spaces a right join sys.filegroups b

    on a.data_space_id = b.data_space_id

  • Please make sure no data files are part of the filegroup.

    SELECT * FROM sys.database_files F

    INNER JOIN sys.filegroups G

    ON F.data_space_id = G.data_space_id

    AND G.name = 'FileGroupCommon'

    BOL states:

    REMOVE FILEGROUP filegroup_name

    Removes a filegroup from the database. The filegroup cannot be removed unless it is empty. Remove all files from the filegroup first. For more information, see "REMOVE FILE logical_file_name," earlier in this topic.

  • i mentioned in my earlier post that there is no file left in the file group. to be perfectly sure, i ran the script you posted. it returns 0 rows.

    this is really frustrating. how can a company like microsoft let there be an obvious bug/error in their one of the most major software? unbelievable!

  • This error usually occurs when a Partition Scheme has been assigned to the filegroup, that you are trying to remove.

    So delete the Partition Scheme that is using the filegroup.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply