April 8, 2008 at 1:41 pm
Hi All,
I have xyz database which is containing 100 user table. Is there any script which I can use to get total number of records in user table seperatly.
Urgent help would be appreciable.
Regards,
Austin
April 8, 2008 at 2:06 pm
Here's one simple way to do that. Just copy-and-paste the results into another query window.
USE MyDatabase
SELECT 'SELECT COUNT(*), ''' + name + ''' FROM ' + name FROM sys.tables
Or you could look at using the stored procedure sp_MSforeachtable.
April 8, 2008 at 2:11 pm
Todd Engen (4/8/2008)
Here's one simple way to do that. Just copy-and-paste the results into another query window.
USE MyDatabase
SELECT 'SELECT COUNT(*), ''' + name + ''' FROM ' + name FROM sys.tables
Or you could look at using the stored procedure sp_MSforeachtable.
Or - right-click on the database, Reports, Standard Reports, Disk Usage by Table (it also includes the record counts and then some).
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
April 8, 2008 at 7:19 pm
Keep in mind those reports are only available if Service Pack 2 is installed.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply