Monday, February 20, 2012

Looking for findcolumn script

I used to have a sql script that searches all tables' columns in a database
for a string in the column name.

For example:
Searching for 'account' will produce all column names with table names that
have the string 'account in their names. AccountNumber.. AccountNum.. etc.

Anyone has such a script?

J.On Mon, 12 Apr 2004 09:32:42 -0700, John Dalberg wrote:

> I used to have a sql script that searches all tables' columns in a database
> for a string in the column name.
> For example:
> Searching for 'account' will produce all column names with table names that
> have the string 'account in their names. AccountNumber.. AccountNum.. etc.
> Anyone has such a script?
> J.

This worked:

select table_name, column_name from information_schema.columns
where column_name like '%account%'

No comments:

Post a Comment