Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save grim-reapper/3dd53025838d5e21fa4e59ea44205426 to your computer and use it in GitHub Desktop.
Save grim-reapper/3dd53025838d5e21fa4e59ea44205426 to your computer and use it in GitHub Desktop.
Search Database Tables for Column Name
# SEARCH DATABASE TABLES FOR COLUMN NAME
SELECT
table_name,
column_name,
data_type,
ordinal_position
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
table_schema = 'change_database_name'
AND column_name LIKE '%change_column_name%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment