How do I list all the columns in a table? How do I list all the columns in a table? sql-server sql-server

How do I list all the columns in a table?


For MySQL, use:

DESCRIBE name_of_table;

This also works for Oracle as long as you are using SQL*Plus, or Oracle's SQL Developer.


For Oracle (PL/SQL)

SELECT column_nameFROM user_tab_colsWHERE table_name = 'myTableName'

For MySQL

SHOW COLUMNS FROM table_name


For MS SQL Server:

select * from information_schema.columns where table_name = 'tableName'