FILE_NAME (Transact-SQL)
SQL Server 2008 R2
Returns the logical file name for the given file identification (ID) number.
The following example returns the file names for file_ID 1 and file_ID in the AdventureWorks2008R2 database.
USE AdventureWorks2008R2; GO SELECT FILE_NAME(1) AS 'File Name 1', FILE_NAME(2) AS 'File Name 2'; GO
Here is the result set.
File Name 1 File Name 2
---------------- ------------------------
AdventureWorks2008R2_Data AdventureWorks2008R2_Log
(1 row(s) affected)