SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 sp_SpaceUsed returns incorrect rowcount
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

AskSQLTeam
Ask SQLTeam Question

USA
0 Posts

Posted - 01/13/2005 :  07:54:58  Show Profile  Visit AskSQLTeam's Homepage  Reply with Quote
Steve writes "I have a table that has 360 rows in it. The query 'Select count(*) from tbl_XX returns 360.

When I execute sp_SpaceUsed 'tbl_XX' the rowcnt field is 358.

I exported the table to Excel and there are 360 rows in it.

What could cause this discrepancy? I would have expeced the sp_SpaceUsed stored procedure to also show 360 rows.

I'm using SQL Server 2000 on Windows 2003 Server.

Steve"

robvolk
Most Valuable Yak

USA
15676 Posts

Posted - 01/13/2005 :  07:59:01  Show Profile  Visit robvolk's Homepage  Reply with Quote
The row count can be inaccurate unless you run sp_spaceused with the updateusage parameter, or run DBCC UPDATEUSAGE beforehand. Books Online has more information about this.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000