Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Detect the Amount of Wasted Data Space in a Table for 2000

By Brian Knight,

SP_WASTED_SPACE will run through each column in your database and print a report of all the character columns. It will then print a report with :

* The maximum length that a column is storing
* The average length of data stored in each column
* The amount of wasted space in each column
* Hints on how to improve performance

Create the stored procedure in the Master database. No parameters are needed if you do that since the procedure reads what database you're in. Just attach to the target database and then run SP_WASTED_SPACE

Will compile only in SQL Server 2000.

It may take some time to run on large active databases, so I would recommend running it on a copy of the database.

Total article views: 1097 | Views in the last 30 days: 1
 
Related Articles
FORUM

Storing Image in the database Column

How to store the image from the vb.net to sql database column

FORUM

Remove Spaces in Columns

How to remove spaces in all columns

ARTICLE

Monitoring Drive and Database Free Space

SQL Server will autogrow your databases as they run out of space. But the process doesn't manage spa...

FORUM

Removing trailing spaces in a table column

Removing trailing spaces in a table column

BLOG

DMV-8 : Check Space consumed by Database……..sys.dm_db_file_space_usage

sys.dm_db_file_space_usage DMV (Dynamic Management View), described by BOL as follows: http://msdn.m...

 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones