Logo 
Search:

SQL Server Articles

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

FILE_NAME Function

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

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

FILE_NAME function is used to get logical file name of given identification number.


Syntax of FILE_NAME Function :

FILE_NAME ( file_id )

file_id is an identification number. It corresponds to the fileid column in sysfiles. It is of type smallint.

Return type of FILE_NAME function is nvarchar(128).



Examples of FILE_NAME Function :

Example 1 : Use of FILE_NAME function in select clause

SELECT FILE_NAME(2)

Output
Northwind_log

Above example returns name of file having id 2 in sysfiles.
  
Share: 

 
 

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

Sarita Patel
Sarita Patel author of FILE_NAME 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!