Tuesday, June 19, 2012

Using fileproperty funciton in SQL Server

fileproperty is database context sensitive.
Returns the specified file name property value when a file name in the current database and a property name are specified. Returns NULL for files that are not in the current database.


propertyies can be:
IsReadOnly,IsPrimaryFile,IsLogFile,SpaceUsed


use databasexxx
select fileproperty('xxxx','spaceused')

here xxxx is the logical file name defined in databasexxx

No comments: