Skip to content

Instantly share code, notes, and snippets.

@lgavish
Last active May 5, 2021 20:08
Show Gist options
  • Save lgavish/7c743a28ec0debbee5249dc4fe897ed4 to your computer and use it in GitHub Desktop.
Save lgavish/7c743a28ec0debbee5249dc4fe897ed4 to your computer and use it in GitHub Desktop.
Extracting table schema from Snowflake
SELECT
'"' || TABLE_CATALOG || '"."' || TABLE_SCHEMA || '"."' || TABLE_NAME || '"' AS FULL_NAME,
COLUMN_NAME,
DATA_TYPE,
COLUMN_DEFAULT,
IS_NULLABLE,
COMMENT,
CHARACTER_MAXIMUM_LENGTH,
NUMERIC_PRECISION,
NUMERIC_SCALE,
DATETIME_PRECISION
FROM "ANALYTICS".information_schema.columns;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment