I need a query in sql to get total columns in a table.Can anybody help?
The below query will display all the tables and corresponding column count in a database schema
SELECT Table_Name, count(*) as [No.of Columns] FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = 'dbo' -- schema name group by table_name