Skip to main content
You can use the information_schema.columns view to return information about all columns in a table in a database. The view is available in each database and contains one row for each column. You can use a SELECT query to return information about each column as shown in the example below. To view column information, the user must have USAGE privileges on both the schema and the database, as well as any necessary table-level privileges or ownership of the table.
When column-level security is in effect, information_schema.columns shows only the columns the current user is permitted to read. Columns that the user has not been granted access to are not visible in this view.

Columns in information_schema.columns

Each row has the following columns with information about each column. The following example retrieves the column names, data types, and nullability for all columns in the tournaments table:

Rows: 7Execution time: 2.79ms