|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, October 07, 2008 5:57 AM
Points: 1,
Visits: 0
|
|
| hi kahe laphare mein pada hai be
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, April 02, 2013 1:48 AM
Points: 1,252,
Visits: 3,367
|
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 12:56 PM
Points: 2,017,
Visits: 2,850
|
|
When I read the article, I was thinking, "why would anyone wnat to know the total number of records in a database?" Then, I ran the code and it listed each table and the records. I misunderstood the point. Age does that to you. 
Anyway, thanks for the code and I will save it for later use. The next time somebody wants to know the number of records in a table, voila, I will use this.
I just got an idea. I will build a .NET front end for this... 
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: 2 days ago @ 2:20 PM
Points: 464,
Visits: 8,717
|
|
Thank you for the compliment.
It absolutely is wonderful to see the row count for each table, the purpose behind the final (total) count is very useful in cases of replication and/or migrating of databases to new servers. Some cases I've found myself replicating a database with 1,000s of tables in it and reviewing each record count per table is a very daunting task.
In my particular instance the replication was done multiple times a day; in that scenario I would 90% of the time review only the total number of records in the entire database for both Publisher A and Subscriber A. If there was a descrepancy then I'd delve further down into the table comparison counts. Of course this is by running the script once each on both the Publisher and Subscriber database. To ensure best possible accuracy I'd once a week or two go through the task of comparing each table (even if the final count matched); just to be 100% accurate and nothing has gone awry in the databases.
I've developed a little more useful script that does a direct comparison of tables between two servers, in a very similar format. It'll provide a table by table direct comparison; it's really only missing the ability to detect missing tables (where Pub A has the table and Subscriber A does not, or vice versa). I'll be providing it to this website in the upcoming week or so; keep an eye out for it, it may prove useful in a .NET front end application (as opposed to running the script seperately on two servers and pulling the data together)...if that's the intention of the app you have in mind.
~ Without obstacles, you cannot progress ~ http://sqln.blogspot.com/
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: 2 days ago @ 1:35 AM
Points: 4,789,
Visits: 1,336
|
|
d----- (10/7/2008) hi kahe laphare mein pada hai be
Please do not waste your time here.
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Sunday, May 12, 2013 11:47 PM
Points: 356,
Visits: 700
|
|
James_DBA (2/10/2009) Thank you for the compliment.
It absolutely is wonderful to see the row count for each table, the purpose behind the final (total) count is very useful in cases of replication and/or migrating of databases to new servers. Some cases I've found myself replicating a database with 1,000s of tables in it and reviewing each record count per table is a very daunting task.
In my case, am setting up a semi-perm table with the output of the query so I can check data growth on a weekly basis. Have been surprised to find one of the DWH tables grew by 750,000 rows in the past 4 days...
Many thanks for reposting very useful code, and for acknowledging the original contribution as you did - big thumbs up to both of you and this miraculously useful forum. --Code modified from original posting on SQLServerCentral.Com --URL: http://www.sqlservercentral.com/scripts/Miscellaneous/30324/
|
|
|
|