Re: Extracting the table names to which a fied is related to



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
.



Relevant Pages

  • Re: SQL Humor
    ... Hugo Kornelis wrote: ... SQL Server will often produce the same execution for both versions. ... the big questions for the RM, *for me* seem to include view updatability which has to do with the operators of the algebra as well as whether a relational engine can implement customary features such as concurrency control and presentation coherence without being written in a language that eschews the relational operators. ...
    (comp.databases.theory)
  • Re: Help with missing data in query
    ... I did go to that site But I couldn't figure out how to upload anything. ... GROUP BY m.MonthName WITH ROLLUP ... Hugo Kornelis, SQL Server MVP ...
    (microsoft.public.sqlserver.mseq)
  • Re: How to Gnerate a Random ID Number
    ... formula with a seed as input to get at a pseudo-random value?) ... that definitely rules out newid() as a "good" pseudo random number ... this on SQL Server 2005, and the seed does not seem to be reset (or at ... Hugo Kornelis, SQL Server MVP ...
    (comp.databases.ms-sqlserver)
  • Re: Not passing back values on an if statement
    ... Hugo Kornelis wrote: ... SQL Server has to check not only that a row ... > column Application doesn't allow NULLs, ... This email account is my spam trap so I ...
    (microsoft.public.sqlserver.programming)
  • Re: mssql: insert into syntax
    ... Hugo Kornelis writes: ... > Your mention of preserving order when rows are deleted makes me think ... INSERT tbl ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)