negative value when I run sp_spaceused

Posted on 2006-05-18
Medium Priority
Last Modified: 2008-02-01

I’ve run sp_spaceused against a table and I got as unused space the value of – (minus) 8KB, which is the size of a data page.

I’ve checked the filegroup that this table belongs to and there is free space for that filegroup.

How come this negative value?

Do I have to do something?

Thank you,
Question by:deepakee
  • 2
LVL 75

Accepted Solution

Aneesh Retnakaran earned 1000 total points
ID: 16711046
Try sp_spaceused @updateusage = true

Author Comment

ID: 16719349
From BOL regarding running updateusage:

"Use it only when you suspect incorrect values are being returned and when the process will not have an adverse effect on other users or processes in the database. If preferred, DBCC UPDATEUSAGE can be run separately."

1) What are the " adverse effect on other users or processes in the database" when running DBCC UPDATEUSAGE?

2) Is it only a performance issue?

2) Any issue with the actual data?

LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 16719768
The -ve value returned by sp_SpaceUsed may be, because of the operations such asl arge delete/update on the tables or dropping of indexes. In such a situations information in the sysindexes tables may not be updated. .

>1) What are the " adverse effect on other users or processes in the database" when running DBCC UPDATEUSAGE?
DBCC Commands take lot of IO and CPU Resources, So Make sure that the CPU is not busy, and you have enough space left in tempDB

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question