Syntax to find the used space and free space of the Data
file in a database(SQL Server). Following queries didn't
give the exact Used space and Free Space Information
sp_spaceused;DBCC showfilestats;exec
MyDbName.dbo.sp_spaceused;SP_HELPFILE
Can any one tell me the query for how to find the exact
used data file space and free space in a Data File?
Answer Posted / narasimha
SELECT name ,size/128.0 - CAST(FILEPROPERTY
(name, 'SpaceUsed') AS int)/128.0 AS AvailableSpaceInMB
FROM sys.database_files;
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What is transactional replication?
What is the difference between for xml raw and for xml auto?
What is report snapshot?
What is order of B+tree?
Can one drop a column from a table?
What is the difference between Stored Procedures and triggers?
How to convert numeric values to integers in ms sql server?
What is outer join in sql server joins?
What is an active database?
Explain in brief how sql server enhances scalability of the database system?
What is spatial and temporal data?
Tell me what is use of except clause? How it differs from not in clause?
How to create a local temporary stored procedure?
What is BCP? When does it used in sql server 2012?
What is trace flag in sql server?