Returns the logical file name for the given file identification number (ID).
FILE_NAME(file_id)
nvarchar(128)
file_ID corresponds to the fileid column in sysfiles.
This example returns the file name for a file_ID of 1 (the master database file).
USE master
SELECT FILE_NAME(1)
Control-of-Flow Language | UPDATE |
DELETE | WHERE |
INSERT | Metadata Functions |
SELECT |