-3

How to list all columns using SQL query?

iBala
  • 235
  • 1
  • 2
  • 13

1 Answers1

1
select column_name, data_type, character_maximum_length
    from INFORMATION_SCHEMA.COLUMNS 
    where table_name = '**table_name**';

This query helps retrieve all columns,datatype in particular table.

iBala
  • 235
  • 1
  • 2
  • 13
  • You might want to explain what the code does. Code only answers are rarely useful to future readers. – BDL Mar 25 '21 at 09:33
  • This query helps retrieve all columns, datatype in particular table. – iBala Apr 17 '23 at 09:14