{"id":791,"date":"2025-10-17T08:49:54","date_gmt":"2025-10-17T08:49:54","guid":{"rendered":"https:\/\/datadandies.nl\/?p=791"},"modified":"2025-10-17T08:49:54","modified_gmt":"2025-10-17T08:49:54","slug":"find-a-column-in-a-database-using-information_schema","status":"publish","type":"post","link":"https:\/\/datadandies.nl\/index.php\/2025\/10\/17\/find-a-column-in-a-database-using-information_schema\/","title":{"rendered":"Find a column in a database using INFORMATION_SCHEMA"},"content":{"rendered":"\n<p>Are you looking for a specific column in all tables in a database? <\/p>\n\n\n\n<p>Use the schema INFORMATION_SCHEMA! It contains metadata about all objects in your database, including columns. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"666\" src=\"https:\/\/datadandies.nl\/wp-content\/uploads\/2025\/10\/20251023-Vind-een-kolom-middels-INFORMATION_SCHEMA-in-een-database-1024x666.png\" alt=\"\" class=\"wp-image-792\" srcset=\"https:\/\/datadandies.nl\/wp-content\/uploads\/2025\/10\/20251023-Vind-een-kolom-middels-INFORMATION_SCHEMA-in-een-database-1024x666.png 1024w, https:\/\/datadandies.nl\/wp-content\/uploads\/2025\/10\/20251023-Vind-een-kolom-middels-INFORMATION_SCHEMA-in-een-database-300x195.png 300w, https:\/\/datadandies.nl\/wp-content\/uploads\/2025\/10\/20251023-Vind-een-kolom-middels-INFORMATION_SCHEMA-in-een-database-768x500.png 768w, https:\/\/datadandies.nl\/wp-content\/uploads\/2025\/10\/20251023-Vind-een-kolom-middels-INFORMATION_SCHEMA-in-een-database.png 1362w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1.3rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * 1.3rem);line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">SQL<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"--Interested in finding a certain column in a certain database? Use INFORMATION_SCHEMA!\nSELECT\n    TABLE_NAME,\n    TABLE_SCHEMA,\n    COLUMN_NAME,\n    DATA_TYPE\nFROM SNOWFLAKE_SAMPLE_DATA.INFORMATION_SCHEMA.COLUMNS\nWHERE 1=1\n    AND COLUMN_NAME ILIKE '%EMPLOYEE%'\n;\" style=\"color:#D4D4D4;display:none\" aria-label=\"Kopieer\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6A9955\">--Interested in finding a certain column in a certain database? Use INFORMATION_SCHEMA!<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">SELECT<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    TABLE_NAME,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    TABLE_SCHEMA,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    COLUMN_NAME,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    DATA_TYPE<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">FROM<\/span><span style=\"color: #D4D4D4\"> SNOWFLAKE_SAMPLE_DATA.INFORMATION_SCHEMA.COLUMNS<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">WHERE<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #B5CEA8\">1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #569CD6\">AND<\/span><span style=\"color: #D4D4D4\"> COLUMN_NAME ILIKE <\/span><span style=\"color: #CE9178\">&#39;%EMPLOYEE%&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">;<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#1E1E1E;color:#c7c7c7;font-size:12px;line-height:1;position:relative\">SQL<\/span><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Are you looking for a specific column in all tables in a database? Use the schema INFORMATION_SCHEMA! It contains metadata about all objects in your database, including columns.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[40],"class_list":["post-791","post","type-post","status-publish","format-standard","hentry","category-blog","tag-snowflake"],"_links":{"self":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts\/791","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/comments?post=791"}],"version-history":[{"count":1,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts\/791\/revisions"}],"predecessor-version":[{"id":793,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts\/791\/revisions\/793"}],"wp:attachment":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/media?parent=791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/categories?post=791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/tags?post=791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}