(TIL) SQL: List Columns in Table

less than 1 minute read

The ANSI standard way of listing all columns in a database table is:

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

Via SO.

Tags: ,

Categories:

Updated:

Comments