Sdílet prostřednictvím


FILEGROUPPROPERTY (Transact-SQL)

Returns the specified filegroup property value when supplied with a filegroup and property name.

Topic link iconTransact-SQL Syntax Conventions

Syntax

FILEGROUPPROPERTY (filegroup_name ,property )

Arguments

  • filegroup_name
    Is an expression of type sysname that represents the name of the filegroup for which to return the named property information.

  • property
    Is an expression of type varchar(128) contains the name of the filegroup property to return. property can be one of these values.

    Value

    Description

    Value returned

    IsReadOnly

    Filegroup is read-only.

    1 = True

    0 = False

    NULL = Input is not valid.

    IsUserDefinedFG

    Filegroup is a user-defined filegroup.

    1 = True

    0 = False

    NULL = Input is not valid.

    IsDefault

    Filegroup is the default filegroup.

    1 = True

    0 = False

    NULL = Input is not valid.

Return Types

int

Remarks

filegroup_name corresponds to the name column in the sys.filegroups catalog view.

Examples

This example returns the setting for the IsDefault property for the primary filegroup in the AdventureWorks database.

USE AdventureWorks;
GO
SELECT FILEGROUPPROPERTY('PRIMARY', 'IsDefault') AS 'Default Filegroup';
GO

Here is the result set.

Default Filegroup 
--------------------- 
1

(1 row(s) affected)