Tuesday, January 19, 2010

Get all columns of a table in SQL

SELECT column_name 'Column Name',
data_type 'Data Type',
CHARacter_maximum_length 'Maximum Length'
FROM information_schema.columns
WHERE table_name =

Also u can run this Query too
select * from information_schema.columns
This view will give you the list of tables and all the columns in those tables with some good information.

No comments:

Post a Comment