Syntax of FILE_ID Function :
FILE_ID ( 'file_name' )
file_name is a name of the file for which to return the file ID. It corresponds to the name column in sysfiles. It is of type nchar(128).
Return type of FILE_ID function is smallint.
Examples of FILE_ID Function :
Example 1 : Use of FILE_ID function in select clause
SELECT FILE_ID('Northwind')
Output
1
Above example returns id for Northwind file.