Solved

sp_spaceused values

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

Independent Software Vendors: 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

Suggested Solutions

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

756 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