Home > Archive > MS SQL Server > March 2006 > Size of a table









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Size of a table
almurph@altavista.com

2006-03-05, 8:23 pm

Hi,

It there a function to determine the size of a table in SQL Server
2000 without running a SELECT count (*)

Al.

Tibor Karaszi

2006-03-05, 8:23 pm

You mean the number of rows? If you want a number that is guaranteed to be accurate, use SELECT
COUNT(*). If the number can be off, you can check in the sysindexes table.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/

Blog: http:// solidqualitylearning
.com/blogs/tibor/



<almurph@altavista.com> wrote in message
news:1141237803.114423.89190@u72g2000cwu.googlegroups.com...
> Hi,
>
> It there a function to determine the size of a table in SQL Server
> 2000 without running a SELECT count (*)
>
> Al.
>


Uri Dimant

2006-03-05, 8:23 pm

run update statistics
sp_spaceused 'tablename'




<almurph@altavista.com> wrote in message
news:1141237803.114423.89190@u72g2000cwu.googlegroups.com...
> Hi,
>
> It there a function to determine the size of a table in SQL Server
> 2000 without running a SELECT count (*)
>
> Al.
>



Tibor Karaszi

2006-03-05, 8:24 pm

Uri,

UPDATE STATISTICS does not change the row count etc in sysindexes. Perhaps you meant DBCC
UPDATEUSAGE?

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/

Blog: http:// solidqualitylearning
.com/blogs/tibor/



"Uri Dimant" <urid@iscar.co.il> wrote in message news:%23Efb2xcPGHA.1192@TK2MSFTNGP11.phx.gbl...
> run update statistics
> sp_spaceused 'tablename'
>
>
>
>
> <almurph@altavista.com> wrote in message
> news:1141237803.114423.89190@u72g2000cwu.googlegroups.com...
>
>


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com