Understanding the System Function FILEPROPERTY()


The SQL Server system function, FILEPROPERTY(), is used to retrieve database file properties. I will show you use cases of this system function to understand how to use it to retrieve the properties of any database files.

The syntax of this function FILEPROPERTY() is given below as per the MSDN documentation.

FILEPROPERTY ( file_name , property )

Here, you need to specify the database file name in place of the file_name argument and the property name that you want to retrieve in place of the property argument. I have listed all the properties that can be retrieved using this function