February 16, 2013

Subscribe

Get Database File Percentage Free Space via Powershell

by Scott Newman

Quick post to get the space left in a database file expressed as a percentage, in case you limit the size of your database files in sql server. I’m not a fan of limiting database file sizes, expressly because most monitoring tools don’t check it (most dbas’ don’t check it either). Most places I’ve been leave this unlimited and check the drive space (which most monitoring tools do check for). There’s an argument to be made for each side, but I reside firmly on the unlimited side of the fence. This happened to me twice yesterday, which only strengthens my argument. This uses SQLPSX.