Thursday, May 14, 2009

Check Database Size and Free Space In SQL Server

How to check or determine database size and how much free space is available to the database through sql query?

To determine database free space use any of the below SQL Server Query.

Query # 1 
USE 
AdventureWorks 
GO 
Exec sp_spaceused 
GO 


The Output would be like below:
 

Query # 2 
USE 
AdventureWorks 
GO 
DBCC showfilestats 
GO 


The Output would be like below:
 

Query # 3 
USE AdventureWorks 
GO 
EXEC sp_spaceused 
GO 


The Output would be like below:

 

Query # 4
USE AdventureWorks; 
GO 
EXEC sp_helpfile; 
GO 


The Output would be like below:


Query # 5 
USE AdventureWorks; 
GO 
SELECT name ,size/128.0 - CAST(FILEPROPERTY

(name, 'SpaceUsed') AS int)/128.0 AS AvailableSpaceInMB 
FROM sys.database_files; 
GO 


The Output would be like below:


 



sql server disk space. free space. disk free space. available free space. available space. disk space. how to find data file free space. how to find database free space. how to find log file space. log space. finding disk space. sql server database free space. how to find actual space used in sql server. how to find actual database space in sql server. actual database space used. actual database space consumed. sql server 2012 space consumed. sql server 2008 r2 space used. sql server 2012 database space consumed. Different ways to determine free space for SQL Server databases. Database Free space report. FreeSpace 2 ship database. Get database size,datafile size, free space, growth and etc

0 comments:

Post a Comment