Get column names in a table

  • Comments posted to this topic are about the item Get column names in a table

  • Hi To find column in a table you posted a code but it is getting results... Here I am posting the code to get column in the table that is also same it is getting results.... but for this i am getting results for one table... but i need all the tables column names in the DB... Plz give me query for that....

    SELECT Column_Name 'Column Name',

    Data_type 'Data Type', character_maximum_length 'Maxium Length'

    FROM information_schema.columns WHERE table_name = 'Table_Name'

    :-):-)suresh:-):-)

  • SELECT Column_Name 'Column Name',table_name 'Table_Name;

    Data_type 'Data Type', character_maximum_length 'Maxium Length'

    FROM information_schema.columns

    GROUP BY table_name

  • Suresh, to get that information for all tables in the database, remove the WHERE clause from the original query.

    Phil Helmer
    Database Engineer

  • Thanks for the script.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply