Returns the file identification number (file ID) for the given logical file name in the current database.
FILE_ID('file_name')
smallint
file_name corresponds to the name column in sysfiles.
This example returns the file ID (1) for the master database.
USE master
SELECT FILE_ID('master')
Control-of-Flow Language | UPDATE |
DELETE | WHERE |
INSERT | Metadata Functions |
SELECT |