Tuesday, June 26, 2012

-- How to get all field names in a table using sql query

You can get the information of the columns in a table programatically using a query.


  -- This query will return all the information of the table named MyTable
  SELECT * 
  FROM   information_schema.columns
  WHERE  table_name = 'MyTable'