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
Do you know the cursor optimization tips?
What is perspective, have you ever created perspective? : sql server analysis services, ssas
What is impersonation? What are the different impersonation options available in ssas? : sql server analysis services, ssas
what authentication modes does sql server support? : Sql server database administration
List some case manipulation functions in sql?
Explain indexing and what are the advantages of it?
Does index slows down insert statements?
Explain how you can deploy an SSRS report?
What is blocking?
what is nonclustered index
What are different types of join?
Is truncate autocommit?
What is the use of partition by in sql server?
What are ddl triggers and types of ddl trigger?
What is nolock hint in sql server 2008