Sign in
Google apps
Main menu
Post a Comment On:
Blogpad
"Query Tables Size"
No comments yet. -
1 – 0 of 0
From
http://goo.gl/dF6Cv
and
http://goo.gl/jxTTa
CREATE TABLE #TempTable
(
tableName varchar(100),
numberofRows varchar(100),
reservedSize varchar(50),
dataSize varchar(50),
indexSize varchar(50),
unusedSize varchar(50)
)
INSERT INTO #TempTable
EXEC sp_MSforeachtable @command1="EXEC sp_spaceused '?'"
SELECT *, cast(cast(replace(reservedSize, ' KB', '') as int)/1024 as varchar) + ' MB' AS Size
FROM #TempTable
ORDER BY cast(replace(reservedSize, ' KB', '') as int) DESC
Result:
[Image]
posted by fc at
12:01 PM
on Jan 3, 2011
Leave your comment
You can use some HTML tags, such as
<b>, <i>, <a>
This blog does not allow anonymous comments.
Google Account
You will be asked to sign in after submitting your comment.
Please prove you're not a robot
"Query Tables Size"
No comments yet. -