Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Tip: Using FILEPROPERTY to Check for Free Space in a Database

Learn how to use FILEPROPERTY to check for free space in a database.


advertisement

Learn how to use FILEPROPERTY to check for free space in a database.

SELECT DB_NAME() AS DBName, 
name AS FileName, 
size/128.0 AS MB, 
size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS 

INT)/128.0 AS FreeMB 
FROM sys.database_files;

 

Visit the DevX Tip Bank

 





   
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date