September 4th, 2007

bswing

GEEK: how to determine which tables have a given field?

Suppose I have a database with a bunch of tables in it. Some of the tables have a stockkey field, but some don’t. Is there a single query that I could run that would display a list of the tables that have a stockkey field? I could write a script that iterated through all of the tables, running a “show table” against each one, but it seems like there might be a way to do it in sql alone.

Original: craschworks - comments