Sunday, July 12, 2009

SQL code

Have you ever had the need to list all the column names in a table in SQL database, do you know how to do it. Here is the code:

select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'TABLE_NAME'

No comments:

Post a Comment