Skip to content

Instantly share code, notes, and snippets.

@AndrewChamp
Last active November 17, 2022 12:32
Show Gist options
  • Save AndrewChamp/dab596f1f902efe980c5ff261b015a17 to your computer and use it in GitHub Desktop.
Save AndrewChamp/dab596f1f902efe980c5ff261b015a17 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