June 6, 2008 at 2:35 pm
Hello all,
Anyone know how can I count all registers from all tables of my data base?
Tks all
June 6, 2008 at 2:38 pm
Not sure what you mean by "registers" in this context.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
June 6, 2008 at 2:45 pm
I just want to COUNT all tables from my database. I can see the most populated tables.
June 6, 2008 at 2:53 pm
use [YourDatabase]
go
select count(*) from sys.tables
go
June 6, 2008 at 3:00 pm
Do you mean a count of the # of rows in each table in a database? Either of these will work although the second would the recommended approach in SQL Server 2005:
Select Object_Name(Id), rows from sys.sysindexes where indid < 2
Select Object_Name(Object_Id), row_count from sys.dm_db_partition_stats
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
June 6, 2008 at 3:02 pm
I think that I'm not expressing fine.
I need to show more populated tables of my db. I need a kind of select to count all registers of all tables.
Select count(*) from table but i need one select to count all tables
June 6, 2008 at 3:13 pm
Jack, your select resolve my problem.
Tks a lot to all.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply