Posted by SQL Enthusiast
Article by our editor
To get the number of rows in a single table we usually use SELECT COUNT(*) or SELECT COUNT_BIG(*). This is quite straightforward for a single table, but quickly gets tedious if there are a lot of tables, and also can be slow. Here are a few ways of listing all the tables that exist in a database together with the number of rows they contain.
Comments (16) • Read full article »
SQL Server provides a lot of information in the Data Management Views (DMVs). This script shows how to identify indexes which are never actually used, by using DMVs such as dm_db_index_usage_stats and dm_db_index_operational_stats.
Comments (1) • Read full article »
More SQL questions »