Returns the file identification (ID) number for the given logical file name in the current database.
This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use FILE_IDEX instead.
Applies to: SQL Server (SQL Server 2008 through current version).
file_name corresponds to the logical file name displayed in the name column in the sys.master_files or sys.database_files catalog views.
In SQL Server, the file identification number assigned to full-text catalogs is greater than 32767. Because the return type of the FILE_ID function is smallint, this function cannot be used for full-text files. Use FILE_IDEX instead.