Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 572
savagepanda Avatar asked Oct 19 '22 14:10

savagepanda


1 Answers

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
like image 94
Vince Horst Avatar answered Oct 23 '22 11:10

Vince Horst