|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 10:37 AM
Points: 447,
Visits: 366
|
|
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
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, June 14, 2013 11:26 AM
Points: 1,073,
Visits: 6,324
|
|
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.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: 2 days ago @ 8:45 PM
Points: 7,002,
Visits: 13,999
|
|
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?
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, June 14, 2013 11:26 AM
Points: 1,073,
Visits: 6,324
|
|
Keep in mind those reports are only available if Service Pack 2 is installed.
|
|
|
|