ITTreats.com
Enter your Search term and Hit "Enter"

Thu, 11 Mar 2010 9:52:15 AM +00:00

Latest 'ITTreats'


Retrieving Column Names of Table in MySQL, SQL Server

Retrieving Column Names of Table in MySQL, SQL Server

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…!!