| title | FILEGROUP_NAME (Transact-SQL) | Microsoft Docs | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| ms.custom | |||||||||
| ms.date | 03/03/2017 | ||||||||
| ms.prod | sql-non-specified | ||||||||
| ms.reviewer | |||||||||
| ms.suite | |||||||||
| ms.technology |
|
||||||||
| ms.tgt_pltfrm | |||||||||
| ms.topic | language-reference | ||||||||
| f1_keywords |
|
||||||||
| dev_langs |
|
||||||||
| helpviewer_keywords |
|
||||||||
| ms.assetid | 26add1c0-56e5-47a8-b489-ae56784a7ee9 | ||||||||
| caps.latest.revision | 26 | ||||||||
| author | BYHAM | ||||||||
| ms.author | rickbyh | ||||||||
| manager | jhubbard |
[!INCLUDEtsql-appliesto-ss2008-xxxx-xxxx-xxx_md]
Returns the filegroup name for the specified filegroup identification (ID) number.
Transact-SQL Syntax Conventions
FILEGROUP_NAME ( filegroup_id )
filegroup_id
Is the filegroup ID number for which to return the filegroup name. filegroup_id is smallint.
nvarchar(128)
filegroup_id corresponds to the data_space_id column in the sys.filegroups catalog view.
The following example returns the filegroup name for the 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)