oikram — 2010-03-18T13:50:37-04:00 — #1
Is there a way to Count all columns from all tables on one database, using the information_schema database ?
dan_grossman — 2010-03-18T15:30:47-04:00 — #2
SELECT COUNT(*) FROM COLUMNS WHERE table_schema = 'dbname'
oikram — 2010-03-19T05:25:56-04:00 — #3
Thanks a lot, I look but I didn't see the COLUMN table existence on information_schema database.
The code provided would return a "no database found error" I believe, but this one will do it:
SELECT COUNT(*) FROM information_schema.COLUMNS WHERE table_schema = 'your_database_name';
Thanks a lot,