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 |
|
elpeak
Starting Member
5 Posts |
Posted - 2007-09-12 : 09:21:09
|
| I want to build metrics on my current table and the historic tables. I want a proc that will do a select count on the tables and email me the results, also insert the results in a table. I can expand different metrics from that point. I've got ideas, but looking for a template that's better than what i have. Thanks |
|
|
Zoroaster
Aged Yak Warrior
702 Posts |
Posted - 2007-09-12 : 17:43:41
|
You can use sp_MSForEachTable stored procedure to do this. For example:use pubsgo create table #rowcount (tablename varchar(128), rowcnt int)exec sp_MSforeachtable 'insert into #rowcount select ''?'', count(*) from ?' Future guru in the making. |
 |
|
|
nathans
Aged Yak Warrior
938 Posts |
Posted - 2007-09-12 : 21:52:47
|
| Have you looked into utilizing the DMVs that come w/ 2005?Nathan Skerl |
 |
|
|
mohit_sme
Starting Member
13 Posts |
|
|
|
|
|