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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With