SQL Server - Is it possible to find the size actually used in an MDF or LDF file
问题 When adding a .MDF ( .NDF ) or .LDF file to a SQL Server, we have the option to set its initial size, auto-growth, and incremental (percent or absolute). After the database is in operation for a while, is it possible find how much of the actual size is used by the data? For example, if the actual size of the file is 5M, but only 2M is used to store the data, the file can still take 3M of data before it needs to grow. I need a way to find out the "2M" (used size) in the total current size (5M)