- Schema:
COLUMNS view¶
This Account Usage view displays a row for each column in the tables defined in the account.
- See also:
Columns¶
Column |
Data Type |
Description |
|---|---|---|
COLUMN_ID |
NUMBER |
Internal/system-generated identifier for the column. |
COLUMN_NAME |
TEXT |
Name of the column. |
TABLE_ID |
NUMBER |
Internal/system-generated identifier for the table or view for the column. |
TABLE_NAME |
TEXT |
Table or view that the column belongs to. |
TABLE_SCHEMA_ID |
NUMBER |
Internal/system-generated identifier for the schema of the table or view for the column. |
TABLE_SCHEMA |
TEXT |
Schema that the table or view belongs to. |
TABLE_CATALOG_ID |
NUMBER |
Internal/system-generated identifier for the database of the table or view for the column. |
TABLE_CATALOG |
TEXT |
Database that the table or view belongs to. |
ORDINAL_POSITION |
NUMBER |
Ordinal position of the column in the table/view. |
COLUMN_DEFAULT |
TEXT |
Default value of the column. |
IS_NULLABLE |
TEXT |
Whether the column allows NULL values. |
DATA_TYPE |
TEXT |
Data type of the column. This column shows the standard Snowflake data type of the column. The DATA_TYPE_ALIAS column displays the original data type name that was specified for the column when the table was created, or when the column was altered. |
CHARACTER_MAXIMUM_LENGTH |
NUMBER |
Maximum length in characters of string columns. |
CHARACTER_OCTET_LENGTH |
NUMBER |
Maximum length in bytes of string columns. |
NUMERIC_PRECISION |
NUMBER |
Numeric precision of numeric columns. |
NUMERIC_PRECISION_RADIX |
NUMBER |
Radix of precision of numeric columns. |
NUMERIC_SCALE |
NUMBER |
Scale of numeric columns. |
DATETIME_PRECISION |
NUMBER |
Not applicable for Snowflake. |
INTERVAL_TYPE |
TEXT |
Not applicable for Snowflake. |
INTERVAL_PRECISION |
TEXT |
Not applicable for Snowflake. |
CHARACTER_SET_CATALOG |
TEXT |
Not applicable for Snowflake. |
CHARACTER_SET_SCHEMA |
TEXT |
Not applicable for Snowflake. |
CHARACTER_SET_NAME |
TEXT |
Not applicable for Snowflake. |
COLLATION_CATALOG |
TEXT |
Not applicable for Snowflake. |
COLLATION_SCHEMA |
TEXT |
Not applicable for Snowflake. |
COLLATION_NAME |
TEXT |
Not applicable for Snowflake. |
DOMAIN_CATALOG |
TEXT |
Not applicable for Snowflake. |
DOMAIN_SCHEMA |
TEXT |
Not applicable for Snowflake. |
DOMAIN_NAME |
TEXT |
Not applicable for Snowflake. |
UDT_CATALOG |
TEXT |
Not applicable for Snowflake. |
UDT_SCHEMA |
TEXT |
Not applicable for Snowflake. |
UDT_NAME |
TEXT |
Not applicable for Snowflake. |
SCOPE_CATALOG |
TEXT |
Not applicable for Snowflake. |
SCOPE_SCHEMA |
TEXT |
Not applicable for Snowflake. |
SCOPE_NAME |
TEXT |
Not applicable for Snowflake. |
MAXIMUM_CARDINALITY |
TEXT |
Not applicable for Snowflake. |
DTD_IDENTIFIER |
TEXT |
Not applicable for Snowflake. |
IS_SELF_REFERENCING |
TEXT |
Not applicable for Snowflake. |
IS_IDENTITY |
TEXT |
Whether the column is an identity column. |
IDENTITY_GENERATION |
TEXT |
Whether an identity column’s value is always generated or only generated by default. Snowflake only supports |
IDENTITY_START |
TEXT |
Not applicable for Snowflake. |
IDENTITY_INCREMENT |
TEXT |
Not applicable for Snowflake. |
IDENTITY_MAXIMUM |
TEXT |
Not applicable for Snowflake. |
IDENTITY_MINIMUM |
TEXT |
Not applicable for Snowflake. |
IDENTITY_CYCLE |
TEXT |
Whether the value of an identity column allows cycling. Snowflake only supports |
IDENTITY_ORDERED |
TEXT |
If |
SCHEMA_EVOLUTION_RECORD |
TEXT |
Records information about the latest triggered Schema Evolution for a given table column. This column contains the following subfields:
|
COMMENT |
TEXT |
Comment for the column. |
DELETED |
TIMESTAMP_LTZ |
Date and time when the column was deleted. |
DATA_TYPE_ALIAS |
TEXT |
The data type alias or synonym specified for the column when the table was created or when the column was last altered. For example, the BIGINT type is synonymous with the NUMBER type. If BIGINT was specified as the type for a column, then BIGINT is displayed in this DATA_TYPE_ALIAS column. For columns in tables that were created before the 2025_07 behavior change bundle was enabled, and not altered after the behavior change, the value in this column is NULL. For more information, see COLUMNS view (multiple schemas): New column. |
Usage notes¶
Latency for the view may be up to 90 minutes.
The view does not recognize the MANAGE GRANTS privilege and consequently may show less information compared to a SHOW command executed by a user who holds the MANAGE GRANTS privilege.
Examples¶
The following example retrieves all columns in the myTable table defined in the mydb database:
SELECT *
FROM SNOWFLAKE.ACCOUNT_USAGE.COLUMNS
WHERE
table_catalog = 'mydb' AND
table_name = 'myTable' AND
deleted IS NULL;