Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server
Azure SQL Managed Instance
This function returns the filegroup property value for a specified name and filegroup value.
Transact-SQL syntax conventions
FILEGROUPPROPERTY ( filegroup_name, property )
filegroup_name
An expression of type sysname that represents the filegroup name for which FILEGROUPPROPERTY
returns the named property information.
property
An expression of type varchar(128) that returns the name of the filegroup property. Property can return one of these values:
Value | Description | Value returned |
---|---|---|
IsReadOnly | Filegroup is read-only. | 1 = TRUE 0 = FALSE NULL = Invalid input. |
IsUserDefinedFG | Filegroup is a user-defined filegroup. | 1 = TRUE 0 = FALSE NULL = Invalid input. |
IsDefault | Filegroup is the default filegroup. | 1 = TRUE 0 = FALSE NULL = Invalid input. |
int
filegroup_name corresponds to the name column from the sys.filegroups catalog view.
This example returns the IsDefault
property setting for the primary filegroup in the AdventureWorks2022 database.
SELECT FILEGROUPPROPERTY('PRIMARY', 'IsDefault') AS 'Default Filegroup';
GO
Here's the result set.
Default Filegroup
---------------------
1
(1 row(s) affected)
FILEGROUP_ID (Transact-SQL)
FILEGROUP_NAME (Transact-SQL)
Metadata Functions (Transact-SQL)
SELECT (Transact-SQL)
sys.filegroups (Transact-SQL)
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today