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
Can you explain the disadvantages/limitation of the cursor?
Why we should not use triggers?
What is buffer cash and log cache in sql server?
How to verify the port number of the sql server?
Write the syntax for stuff function in an sql server?
What is faster join or union?
Do you know clustered and non-clustered index?
What is the use of custom fields in report?
What are the different types of columns types constraints in the sql server?
What is the datatype of rowid?
How raid can influence database performance?
Why do you want to join software field as you have done your BE in Electronics?
How to loop through the result set with @@fetch_status?
What is database dimension? : sql server analysis services, ssas
What are the security related catalog views? : sql server security