Re: Extracting the table names to which a fied is related to
- From: Hugo Kornelis <hugo@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 12 May 2008 00:23:51 +0200
On Fri, 9 May 2008 09:50:01 -0700, Jatin Gulati <Jatin
Gulati@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I am using a database with n tables in it. I have a set of field names with
me. what I want is to find the names of the tables in which a particular
field is mapped to or related to in order to find the effect of a particular
field to the database.
Hi Jatin,
SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME = 'Name of column you need';
--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
.
- References:
- Extracting the table names to which a fied is related to
- From: Jatin Gulati
- Extracting the table names to which a fied is related to
- Prev by Date: Re: Loop through records
- Next by Date: Cannot Reference Named Column in WHERE Clause
- Previous by thread: Extracting the table names to which a fied is related to
- Next by thread: Cannot Reference Named Column in WHERE Clause
- Index(es):
Relevant Pages
|
|