savagepanda
savagepanda

Reputation: 877

Is there a system table that lists all file groups?

For example master.sys.master_files lists all files for all databases. It also lists data_space_id which maps to the file groups.

But the master.sys.filegroups table only lists file groups used by the master database. Is there such a table where I can get all file groups across all databases?

Upvotes: 6

Views: 4629

Answers (1)

Vince Horst
Vince Horst

Reputation: 5308

To my knowledge there is not a single table or view which shows the file groups for all databases in the instance.

There is however a view called sys.filegroups in each database which will list the file groups for that particular database.

Example

USE [MyDatabase]
select * from sys.filegroups

Upvotes: 4

Related Questions