Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How can we get count of the number of records in a table?

946


Can a unique index be created on a column, which contains null?

915


How can I track the changes or identify the latest insert-update-delete from a table?

944


What are window functions in sql server?

999


What is a derived table?

920


What is spatial and temporal data?

991


Is INSTEAD OF trigger directly applicable to Table ?

1009


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?

1027


How to filter out duplications in the returning rows in ms sql server?

1126


What is measure group, measure? : sql server analysis services, ssas

999


What is the difference between for trigger and after trigger?

1098


How to connect ms access to sql servers through odbc?

1017


What is sql server locking?

976


How to generate random numbers with the rand() function in ms sql server?

1136


What is mean by dml?

998