It is very simple to find out the space used by any table in database.
USE AdventureWorks;
GO
EXEC sp_spaceused 'Sales.Customer';
GO

Reference : Pinal Dave (http://blog.SQLAuthority.com)
July 8, 2008 by pinaldave
It is very simple to find out the space used by any table in database.
USE AdventureWorks;
GO
EXEC sp_spaceused 'Sales.Customer';
GO

Reference : Pinal Dave (http://blog.SQLAuthority.com)
Posted in Pinal Dave, SQL, SQL Authority, SQL Data Storage, SQL Query, SQL Scripts, SQL Server, SQL Stored Procedure, SQL Tips and Tricks, T SQL, Technology | 6 Comments
Pinalkumar Dave is a Microsoft SQL Server MVP and a Mentor for Solid Quality India. He has written over 1100 articles on the subject on his blog at http://blog.sqlauthority.com. He is a dynamic and proficient Principal Database Architect, Corporate Trainer and Project Manager, who specializes in SQL Server Programming and has 7 years of hands-on experience. He holds a Masters of Science degree and a number of certifications, including MCDBA and MCAD (.NET). He was awarded Regional Mentor for PASS Asia.
This is the best SQL Blog ever. TY.
Cool tip. I really enjoy your blog! I come here whenever I have a SQL problem. Thanks!
Hi Pinal,
Does it shows the excat data. Suppose there is bulk operation happed in that case it will show the excat data..?
Hi Pinal,
Is there any way to use replace function for ntext data type. If i want to change a particular text in all columns and all tables in a database. How can i resolved it ?
Please suggest. Thanks in advanced
I think you need to run DBCC UpdateUsage before you run sp_spaceused in order to get a correct result.
You will need to have sa role to find the space usage of all databases. Is there any work around for this?