Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sp_spaceused vs select count(*)

Status
Not open for further replies.

mannymo

MIS
Dec 23, 2002
15
0
0
US
I DTS data from sybase ASE to SQL server2000.
When I check the row size on the two tables using sp_spaceused I get diffenent results than using select count(*). I disconnect from the SQL server to make sure I refresh.
Sybase contains the correct row count, the SQL row count is always lower with sp_spaceused, select count(*) brings back the correct row count.
This is not the only table that I DTS from Sybase, the other 13 tables all bring back the correct row count using sp_spaceused.
Any idea why?
Thanks, Manny
 
Try running DBCC UPDATEUSAGE first and then sp_spaceused. That may correct the problem.

I have a similar problem but with replicatication. I will post very soon.
 
Thanks that worked, but I had to put in WITH COUNT_ROWS.
Syntax; DBCC UPDATEUSAGE ('<DB>','<TABLE_NAME>') WITH COUNT_ROWS
Thanks, Manny
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top