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?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / allah baksh
exec sp_spaceused [schema.tablename] this will give you
data file and the size available
Is This Answer Correct ? | 0 Yes | 0 No |
What program is used to store the data source file?
How do I create a partition table in sql server?
What is the use of floor function in sql server?
How to reaname table name without using sp_Rename in sql server..?
What is difference in performance between insert top (n) into table and using top with insert?
How important do you consider cursors or while loops for a transactional database?
About types of indexes in SQL server ?
Mention the command used to rename the database.
Rate yourself in .NET and SQL ?
1 Answers Cognizant, HCL, SunGard,
What is an indexing technique?
What is the command used to check locks in microsoft sql server?
What does REVERT do in SQL Server 2005?