Retrieving Column Names of Table in MySQL, SQL Server

Share this Article :


When you do select query that will give you only records available,
in some conditions we may require Column names of table for dynamic query generating programs for that purpose here is the query for retrieving Column Names

In MySQL :

SHOW COLUMNS FROM <table name>

In SQLServer

Select column_name from information_schema.columns where table_name =<tablename>

for more infomation on table try with
select * from inormation_schema.columns where table_name=<table name

!!happy coding…!!

Written by adrevol

{adrevol has written 91 posts on ITTreats.com . See all posts by }


Leave a Reply