Well first thing first, when you have to analyze a database, you might want to see how big it is, and how much records are there in each table.
One way is to get count for each table like
Select Count(0) From Table1;
But if you have more then 100 tables in the system it will be very difficult to do so, so you might need a query which can list all the tables in the database with its row count, thanks to the master database which store all these info for you. Here is the query which will bring the list for you.
Select
sob.name,
dbps.row_count
From sys.dm_db_partition_stats dbps
Inner join sys.sysobjects sob on sob.id = dbps.object_id
Where sob.type = 'U' And dbps.index_id = 1
One way is to get count for each table like
Select Count(0) From Table1;
But if you have more then 100 tables in the system it will be very difficult to do so, so you might need a query which can list all the tables in the database with its row count, thanks to the master database which store all these info for you. Here is the query which will bring the list for you.
Select
sob.name,
dbps.row_count
From sys.dm_db_partition_stats dbps
Inner join sys.sysobjects sob on sob.id = dbps.object_id
Where sob.type = 'U' And dbps.index_id = 1
