Showing posts with label index_size. Show all posts
Showing posts with label index_size. Show all posts

Monday, March 12, 2012

Inconsistent sp_spaceused

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 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?|||Nope, didn't help a bit: still shows 0 records yet roughly 7MB of taken space.
"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...
> > 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?
>
>|||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:
> Nope, didn't help a bit: still shows 0 records yet roughly 7MB of taken space.
> "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...
> > > 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?
> >
> >
> >|||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?

Inconsistent sp_spaceused

When I run sp_spaceused 'table', @.updateusage = 'TRUE', here is what I get:
name rows reserved data index_size unused
-- -- -- -- -- --
table 0 7253 KB 5020 KB 32 KB 2201 KB
How come that empty table still occupies lots of space?It seems that in some moment before such table contained rows (and had an
index).
Try a DBCC UPDATEUSAGE on the whole database or DBCC CHECKTABLE on the
interested table
"Leon Shargorodsky" wrote:
> When I run sp_spaceused 'table', @.updateusage = 'TRUE', here is what I get:
> name rows reserved data index_size unused
> -- -- -- -- -- --
> table 0 7253 KB 5020 KB 32 KB 2201 KB
> How come that empty table still occupies lots of space?

Inconsistent sp_spaceused

When I run sp_spaceused 'table', @.updateusage = 'TRUE', here is what I get:
name rows reserved data index_size unused
-- -- -- -- -- --
table 0 7253 KB 5020 KB 32 KB 2201 KB
How come that empty table still occupies lots of space?It seems that in some moment before such table contained rows (and had an
index).
Try a DBCC UPDATEUSAGE on the whole database or DBCC CHECKTABLE on the
interested table
"Leon Shargorodsky" wrote:

> When I run sp_spaceused 'table', @.updateusage = 'TRUE', here is what I get
:
> name rows reserved data index_size unused
> -- -- -- -- -- --
> table 0 7253 KB 5020 KB 32 KB 2201 KB
> How come that empty table still occupies lots of space?