Skip to content

Instantly share code, notes, and snippets.

@dieissonmartins
Created October 9, 2023 13:28
Show Gist options
  • Save dieissonmartins/0e6e6fc9eb9d7165aca45ca6e552cb6c to your computer and use it in GitHub Desktop.
Save dieissonmartins/0e6e6fc9eb9d7165aca45ca6e552cb6c to your computer and use it in GitHub Desktop.
SELECT VIEWS.TABLE_NAME AS view_name,
VIEWS.VIEW_DEFINITION AS view_definition,
TABLES.TABLE_NAME AS source_table
FROM INFORMATION_SCHEMA.VIEWS AS VIEWS
JOIN
INFORMATION_SCHEMA.TABLES AS TABLES
ON
VIEWS.TABLE_NAME = TABLES.TABLE_NAME;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment