SQL SERVER -Find Total No of a Rows of All Tables in a Given Database

Today one of my friend sreejith (colleague) came and ask me, how to find the total numbers of rows of all tables in a given database.The solution is

SELECT ‘[‘ + Schema_name(t.schema_id) + ‘].[‘ + t.name + ‘]’ AS fulltable_name,
Schema_name(t.schema_id) AS schema_name,
t.name AS table_name,
FROM sys.tables AS t
INNER JOIN sys.sysindexes AS i
ON t.object_id = i.id
AND i.indid < 2


SQL Server 2011 – Code Named Denali

Dear readers,

SQL Server 2011 – Code Named “Denali” was released November 9th 2010. Two main DBA’s had written about the Denali. The links are,

Get ready for the revolution from Microsoft in Database Servers.

SQL SERVER – Total No of Columns in a Table for a given Database

One evening my friend Preethy came ask, “Can we find the how much columns are there in a table For a given database?”. I had given a script to her.

Total no of columns in a table for a given database

Query to find all sum of columns in a table of a given database.

Total no of columns for each tables of a given database.