Back
It is possible to find the number of rows in a table:
select count(*) from tablename
Is it possible to find the number of columns in a table?
Try using this code:
SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_catalog = 'database_name' -- the database AND table_name = 'table_name'
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_catalog = 'database_name' -- the database
AND table_name = 'table_name'
31k questions
32.8k answers
501 comments
693 users