Counting and Listing the Columns in Table
I am going to explain how you can List all the columns and also count the columns from a table .
The following code snippt will list all the columns from the table
SELECT * FROM information_schema.columns
WHERE table_name = '<table_name>' AND table_catalog='<database_name>'
you may ommit the table
SELECT count(1) FROM information_schema.columns
WHERE table_name = '<table_name>'
Note: Please note that the table name should be correct other wise it will return 0