SQL 2000 Enterprise, SP4, 8.00.2175
sp_spaceused 'table', @.updateusage = 'TRUE' returns this:
name rows reserved data index_size
unused
-- -- -- -- --
--
table 0 7248 KB 5032 KB 32 KB
2184 KB
How come my table has 0 records yet still occupies space?Check out DBCC UPDATEUSAGE and the ROWS_COUNT option.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in me
ssage
news:A1FBD362-9CB9-41F1-A57A-6662C4BFF5A8@.microsoft.com...
> SQL 2000 Enterprise, SP4, 8.00.2175
> sp_spaceused 'table', @.updateusage = 'TRUE' returns this:
> name rows reserved data index_size
> unused
> -- -- -- -- --
--
> --
> table 0 7248 KB 5032 KB 32 KB
> 2184 KB
> How come my table has 0 records yet still occupies space?|||Nope, didn't help a bit: still shows 0 records yet roughly 7MB of taken spac
e.
"Tibor Karaszi" wrote:
> Check out DBCC UPDATEUSAGE and the ROWS_COUNT option.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in
message
> news:A1FBD362-9CB9-41F1-A57A-6662C4BFF5A8@.microsoft.com...
>
>|||Leon Shargorodsky,
if you dropped a variable length column, you can reclaim the space using
"dbcc cleantable".
If it is a heap (table without clustered index), create a clustered index
and if you do not want to keep it then drop it.
If it is not a heap, use "dbcc dbreindex" or "alter index ... rebuild" if
you are using 2005.
AMB
"Leon Shargorodsky" wrote:
[vbcol=seagreen]
> Nope, didn't help a bit: still shows 0 records yet roughly 7MB of taken sp
ace.
> "Tibor Karaszi" wrote:
>|||sp_spaceused is not guaranteed to provide actual, up-to-the-minute correct
values. DO NOT rely on it for such.
TheSQLGuru
President
Indicium Resources, Inc.
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in
message news:A1FBD362-9CB9-41F1-A57A-6662C4BFF5A8@.microsoft.com...
> SQL 2000 Enterprise, SP4, 8.00.2175
> sp_spaceused 'table', @.updateusage = 'TRUE' returns this:
> name rows reserved data index_size
> unused
> -- -- -- -- --
--
> --
> table 0 7248 KB 5032 KB 32 KB
> 2184 KB
> How come my table has 0 records yet still occupies space?
Monday, March 12, 2012
Inconsistent sp_spaceused
Labels:
2175sp_spaceused,
database,
enterprise,
inconsistent,
microsoft,
mysql,
oracle,
reserved,
returns,
rows,
server,
sp_spaceused,
sp4,
sql,
thisname,
updateusage
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment