FIX: Database Usage Count Does Not Return to Zero

ID: Q175303


The information in this article applies to:

BUG #: 17305

SYMPTOMS

When all users have logged out of a particular database, the database may still have a usage count of greater than 0. If it does, errors will occur when you attempt to set the database to single user mode, or when you try to drop the database. To see if you are having this problem, perform the steps listed in the MORE INFORMATION section of this article.


WORKAROUND

To work around this problem, shut down SQL Server and restart it. Doing this brings the usage count back to zero.


STATUS

Microsoft has confirmed this to be a problem in SQL Server version 6.5. This problem was corrected in the latest Microsoft SQL Server 6.5 U.S. Service Pack. For information on obtaining the service pack, query on the following word in the Microsoft Knowledge Base (without the spaces):


   S E R V P A C K 


MORE INFORMATION

To check to see if this problem is occurring, perform the following steps:

  1. Execute the sp_who stored procedure.


  2. Examine the output and make sure that there are no connections in the database.


  3. Run DBCC TRACEON(3604), followed by DBCC DBTABLE(<database name>).


The DBTABLE output will have an output parameter called dbt_open. This value keeps track of how many users are in the database. If this value is greater than one and the sp_who output shows that there is nobody in the database, then this bug may be the cause. This problem generally only happens after periods of very high SQL Server activity accompanied by dump transactions.

Additional query words: run statement zero noone no one


Keywords          : kbusage SSrvGen kbbug6.50 kbfix6.50.sp4 
Version           : WINNT:6.5
Platform          : winnt 
Issue type        : kbbug 

Last Reviewed: April 16, 1999