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 normalization process?
In which files does sql server actually store data?
What are distributed partitioned views?
what are defaults? : Sql server database administration
How to provide login information for a new odbc dsn?
how many triggers you can have on a table? : Sql server database administration
Can foreign key be duplicate?
How retrieve field names from the table in SQL through JAVA code?
What are cursors in ms sql server?
Please explain what is “asynchronous” communication in sql server service broker?
How to concatenate two strings in SQL Server.
Can We Use Data-grids For Our Report In Ssrs?
Help!!!!!!!!!!!! My database has gone offline, it is highlighted as 'Suspect'. Foolishly, i haven't got a recent back up. Is there a way of quickly restoring the database? Thank you
Why I am getting "the microsoft .net framework 2.0 in not installed" message?
what is raid? : Sql server database administration