Logo 
Search:

SQL Server Articles

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

FILEGROUP_ID Function

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

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

FILEGROUP_ID function is used to get filegroup identification number for filegroup name.


Syntax of FILEGROUP_ID Function :

FILEGROUP_ID ( 'filegroup_name' )

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

Return type of FILEGROUP_ID function is smallint.



Examples of FILEGROUP_ID Function :

Example 1 : Use of FILEGROUP_ID function in select clause

SELECT FILEGROUP_ID('primary')

Output
1

Above example returns filegroup id for filegroup name primary.
  
Share: 

 
 

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

Sarita Patel
Sarita Patel author of FILEGROUP_ID 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!