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
How can we get count of the number of records in a table?
Can a unique index be created on a column, which contains null?
How can I track the changes or identify the latest insert-update-delete from a table?
What are window functions in sql server?
What is a derived table?
What is spatial and temporal data?
Is INSTEAD OF trigger directly applicable to Table ?
You schedule a job to run every minute what will happen if the first job runs more than 1 min? Will the second instance of the job start?
How to filter out duplications in the returning rows in ms sql server?
What is measure group, measure? : sql server analysis services, ssas
What is the difference between for trigger and after trigger?
How to connect ms access to sql servers through odbc?
What is sql server locking?
How to generate random numbers with the rand() function in ms sql server?
What is mean by dml?