Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sanjay5219
Posting Yak Master
240 Posts |
Posted - 2010-09-01 : 08:39:58
|
| Hi All,is there any query by which we can know that which table is haveing how many rowsplease suggest |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-09-01 : 08:43:28
|
| http://beyondrelational.com/blogs/madhivanan/archive/2007/11/02/different-ways-to-count-rows-from-a-table.aspxMadhivananFailing to plan is Planning to fail |
 |
|
|
sanjay5219
Posting Yak Master
240 Posts |
Posted - 2010-09-01 : 08:49:45
|
| i want to check all table in one shot. |
 |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2010-09-01 : 08:51:28
|
| if sql server 2005 are highExec sp_MsForEachTable 'select ''?'' as table_name,count(1) as no_of_rows from ?'Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-09-01 : 08:51:33
|
| select object_name(id) as table_name, rows from sysindexes where indid<2MadhivananFailing to plan is Planning to fail |
 |
|
|
sanjay5219
Posting Yak Master
240 Posts |
Posted - 2010-09-01 : 09:18:45
|
| Thanks Madhivanan |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-09-02 : 04:15:39
|
quote: Originally posted by sanjay5219 Thanks Madhivanan
You are welcome MadhivananFailing to plan is Planning to fail |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-09-02 : 04:16:42
|
quote: Originally posted by senthil_nagore if sql server 2005 are highExec sp_MsForEachTable 'select ''?'' as table_name,count(1) as no_of_rows from ?'Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/
It will work in all versions. But beware that it is undocumented and will be removed from future versionsMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|