I would like to get some stats out of a database Mainly I would like to get
the no records in each table and if possible the size of each table, not
sure if the latter is possible?
Thanks
DerrickDerrick,
Try using "dbcc checktable"
eg:
use db_audit
go
dbcc checktable('tblaudit')
go
DBCC results for 'tblAudit'.
There are 126452 rows in 1305 pages for object 'tblAudit'.
DBCC execution completed. If DBCC printed error messages, contact your
system administrator.
Each page in SQL Server 2000 is 8kb. I'm not sure about other versions.
I'm fairly sure you can use "dbcc checkdb" to return information about
all of the tables in a database in a similar form.
I hope this helps,
Danny.
"Derrick King" <derrick.king@.bradford.gov.uk> wrote in message
news:belrgl$8hl$1@.newsreaderm1.core.theplanet.net...
> I would like to get some stats out of a database Mainly I would like to
get
> the no records in each table and if possible the size of each table, not
> sure if the latter is possible?
> Thanks
> Derrick
>|||> Each page in SQL Server 2000 is 8kb. I'm not sure about other versions.
> I'm fairly sure you can use "dbcc checkdb" to return information about
> all of the tables in a database in a similar form.
Yes, DBCC CHECKDB can also used. Also, DBCC CHECKDB should return accurate info. Note that
CHECKDB also does physical checking, so it might take a while.
One thing about my first suggestion: You might want to run DBCC UPDATEUSAGE using the COUNT_ROWS
parameter to update rowcount as well as space usage.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Daniel Johnson" <danny@.sysola.net> wrote in message news:belsc8$9h2$1@.titan.btinternet.com...
> Derrick,
> Try using "dbcc checktable"
> eg:
> use db_audit
> go
> dbcc checktable('tblaudit')
> go
> DBCC results for 'tblAudit'.
> There are 126452 rows in 1305 pages for object 'tblAudit'.
> DBCC execution completed. If DBCC printed error messages, contact your
> system administrator.
> Each page in SQL Server 2000 is 8kb. I'm not sure about other versions.
> I'm fairly sure you can use "dbcc checkdb" to return information about
> all of the tables in a database in a similar form.
> I hope this helps,
> Danny.
>
> "Derrick King" <derrick.king@.bradford.gov.uk> wrote in message
> news:belrgl$8hl$1@.newsreaderm1.core.theplanet.net...
> > I would like to get some stats out of a database Mainly I would like to
> get
> > the no records in each table and if possible the size of each table, not
> > sure if the latter is possible?
> >
> > Thanks
> >
> > Derrick
> >
> >
>