FILEPROPERTY (Transact-SQL)
Returns the specified file name property value when a file name and property name are specified.
The following example returns the setting for the IsPrimaryFile property for the AdventureWorks_Data file name in the AdventureWorks database.
USE AdventureWorks;
GO
SELECT FILEPROPERTY('AdventureWorks_Data', 'IsPrimaryFile')AS [Primary File];
GO
Here is the result set.
Primary File ------------- 1 (1 row(s) affected)
