Wednesday, June 15, 2011

Query to get the all table names with their total number of columns stored in ms sql server

In this programming tutorial you will learn the query to get the all table names with their total number of columns stored in ms sql server. Its quite easy. Lets have a look over the query given below.

select table_name,count(*) as total_columns from information_schema.COLUMNS
GROUP BY table_name order by table_name asc 

 







Share:






















0 comments:

Post a Comment