Logo 
Search:

SQL Server Articles

Submit Article
Home » Articles » SQL Server » Meta Data FunctionsRSS Feeds

FILEGROUPPROPERTY Function

Posted By: Sarita Patel     Category: SQL Server     Views: 1262

This article explains about FILEGROUPPROPERTY function in sql server with examples.

FILEGROUPPROPERTY function is used to get property value for specified filegroup and property name.



Syntax of FILEGROUPPROPERTY Function :

FILEGROUPPROPERTY ( filegroup_name, property )

filegroup_name is a name of filegroup. It corresponds to the groupname column in sysfilegroups. It is of type nvarchar(128).

property is a name of the filegroup property. It is of type varchar(128) and can be of below values.

Value

Description

Returned Value

IsReadOnly

Filegroup name is read-only.

1 = True
0 = False
NULL = Invalid input

IsUserDefinedFG

Filegroup name is a user-defined filegroup.

1 = True
0 = False
NULL = Invalid input

IsDefault

Filegroup name is the default filegroup.

1 = True
0 = False
NULL = Invalid input



Return type of  FILEGROUPPROPERTY function is integer.




Examples of FILEGROUPPROPERTY Function :

Example 1 : Use of FILEGROUPPROPERTY function in select clause

SELECT FILEGROUPPROPERTY('primary', 'IsDefault')

Output
1

Above example returns value 1 for property IsDefault means primary filegroup is a default filegroup. 
  
Share: 

 
 

Didn't find what you were looking for? Find more on FILEGROUPPROPERTY Function Or get search suggestion and latest updates.

Sarita Patel
Sarita Patel author of FILEGROUPPROPERTY Function is from United States.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!