how to get column names of a table in sql

sid
sid
Member
120 Points
9 Posts

Hi,

how to get column names of a table in sql?

Views: 8921
Total Answered: 1
Total Marked As Answer: 1
Posted On: 04-Jun-2015 10:35

Share:   fb twitter linkedin
Answers
Brian
Brian
Moderator
2232 Points
14 Posts
         

Hi Sid,

Use the INFORMATION_SCHEMA.COLUMNS view allows you to get information about all columns in a table within a database as:

SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME='TABLENAME'

 

Posted On: 04-Jun-2015 10:47
 Log In to Chat