Solved

sp_spaceused values

Posted on 2006-10-22
2
316 Views
Last Modified: 2006-11-18
Hi I run sp_spaceused and following result display in qa

db name=rtc
db size= 900.00MB
unallocated space = -200.86MB why it has negative value over here??
0
Comment
Question by:motioneye
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
Raynard7 earned 500 total points
ID: 17785918
Hi,

This seems to occur with reasonable regularity whenever large transactions are used.

sp_spaceused uses sysindexes.dpages, which in turn gets out of whack over time as the result of various activities, such as database shrinks, large-scale insert / update / delete activity, truncations etc. To correct this, simply run DBCC UPDATEUSAGE (0) but beware - this is a heavy hitting statement that can hurt a busy server, so I suggest you schedule it to run during a period of low utilisation. DBCC UPDATEUSAGE can be used to update sysindexes for all indexes, or those of a specific table (details in BOL).

from http://www.stillhq.com/sqldownunder/archives/msg02087.html
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17786356
Hi motioneye,

i agree with Raynard, this is because of the bulk activities. To correct this you can use DBCC UPDATEUSAGE as mentioned above or use    

sp_spaceused @updateusage = 'TRUE'




Cheers!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

751 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