SQL Server Articles

Submit Article
Home » Articles » SQL Server » Meta Data FunctionsRSS Feeds

FILE_ID Function

Posted By: Sarita Patel     Category: SQL Server     Views: 10709

This article explains about FILE_ID function in sql server with examples.

FILE_ID function is used to get file identification number for logical file name in the current database.

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')


Above example returns id for Northwind file.


Didn't find what you were looking for? Find more on FILE_ID Function Or get search suggestion and latest updates.

Sarita Patel
Sarita Patel author of FILE_ID Function is from United States.
View All Articles

Related Articles and Code:

Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

No Comment Found, Be the First to post comment!