Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get the amount of records in tables of a database...
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00565267
Message ID:
00565291
Views:
18
This message has been marked as the solution to the initial question of the thread.
>How can I Get the amount of records in tables of a database?
>
>I like to have a SP that create a record set with the name of tables and number of records.
>
>Is there a simple way to do this?

It's pretty easy to get the list of the tables in current database
SELECT table_name FROM INFORMATION_SCHEMA.TABLES
	WHERE table_type = 'BASE TABLE'
After that you can query them one by one using dynamic SQL.
Another way is presented in article 'Obtaining Record Counts' at http://www.sqlmag.com/Articles/Index.cfm?ArticleID=5236 but it queries system tables directly wich is not recomended by MS.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform