Tuesday 9 September 2014

Mysql, Query to find out table comments?

To List all tables from database use: 

show tables from DatabaseName;


To List Table Structure you can use: 

DESC tablename;
Or You can use
SHOW COLUMNS FROM file FROM DatabaseName;

Query to find out Comments on Table

SELECT a.COLUMN_NAME, a.COLUMN_COMMENT FROM information_schema.COLUMNS a WHERE a.TABLE_NAME = 'YOUR_TABLE_NAME'

Just Change the name of YOUR_TABLE_NAME and run it.

No comments:

Post a Comment