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
Solved

sp_spaceused values

Posted on 2006-10-22
2
314 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
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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

808 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