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

Mon, 08 Feb 2010 11:19:23 PM +00:00


Retrieving Column Names of Table in MySQL, SQL Server

Retrieving Column Names of Table in MySQL, SQL Server
Posted on March 8th, 2009 in MYSQL by adrevol

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

VN:F [1.8.1_1037]
Rating: 0.0/5 (0 votes cast)
VN:F [1.8.1_1037]
Rating: 0 (from 0 votes)


P.S. : Please post us Your Valuable Comments on this Article

Written by : adrevol
( Treats Given : 35 Treats Attended : )

Post a comment