Microsoft SQL Server 2005
Performance Tuning
Best Practices

How to monitor disk free space?

 

Execute the following script in Query Editor to create a table as free space log and deploy the insert script into SQL Server Agent for daily, weekly, etc. execution. Database files used space can be obtained by sp_helpfiles command.

USE AdventureWorks
GO


CREATE TABLE DBDiskFree (
DBDiskFreeID INT identity(1,1) primary key,
DriveLetter CHAR(1) NOT NULL,
FreeMB INTEGER NOT NULL,
DateStamp datetime default (getdate()))
GO

/* Populate DBDiskFree with data */
INSERT INTO DBDiskFree (DriveLetter, FreeMB)
EXEC master..xp_fixeddrives
GO

SELECT * FROM DBDiskFree
GO



 

The Best SQL Server 2005 Training in the World
 
 
SQLUSA.com Home Page