Get Size of tables in MS SQL Part 2
One of the most hit articles on my blog is how to get the size of MS SQL tables with CF. I have always meant to get back to the idea and make a non CF based solution. Here is a different / better way to get the table sizes:
SET @SQL = 'DBCC UPDATEUSAGE (' + DB_NAME() + ')'
EXEC(@SQL)
CREATE TABLE #foo
(
name VARCHAR(255),
rows INT ,
reserved varchar(255),
data varchar(255),
index_size varchar(255),
unused varchar(255)
)
INSERT into #foo
EXEC sp_MSForEachtable 'sp_spaceused ''?'''
SELECT *
FROM #foo
DROP TABLE #foo

There are no comments for this entry.
[Add Comment]