| title | FILEGROUP_NAME (Transact-SQL) | Microsoft Docs | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| ms.custom | |||||||||
| ms.date | 03/03/2017 | ||||||||
| ms.prod | sql | ||||||||
| ms.prod_service | sql-database | ||||||||
| ms.reviewer | |||||||||
| ms.technology | t-sql | ||||||||
| ms.topic | language-reference | ||||||||
| f1_keywords |
|
||||||||
| dev_langs |
|
||||||||
| helpviewer_keywords |
|
||||||||
| ms.assetid | 26add1c0-56e5-47a8-b489-ae56784a7ee9 | ||||||||
| author | MikeRayMSFT | ||||||||
| ms.author | mikeray |
[!INCLUDEtsql-appliesto-ss2008-xxxx-xxxx-xxx-md]
This function returns the filegroup name for the specified filegroup identification (ID) number.
Transact-SQL Syntax Conventions
FILEGROUP_NAME ( filegroup_id )
filegroup_id
The filegroup ID number whose filegroup name FILEGROUP_NAME will return. filegroup_id has a smallint data type.
nvarchar(128)
filegroup_id corresponds to the data_space_id column of the sys.filegroups catalog view.
This example returns the filegroup name for filegroup ID 1 in the [!INCLUDEssSampleDBnormal] database.
SELECT FILEGROUP_NAME(1) AS [Filegroup Name];
GO
[!INCLUDEssResult]
Filegroup Name
-----------------------
PRIMARY
(1 row(s) affected)
Metadata Functions (Transact-SQL)
SELECT (Transact-SQL)
sys.filegroups (Transact-SQL)