Pages

Tuesday, 28 May 2013

Find table name from Column Name

One of my friend ask to provide data as invoice_no,supplier_code etc. of Supplier.Now my database have more than 300 tables and it is difficult to find which table have these column names manually.So I  find it  by querying on joining of  sysobjects and sys.columns

Example:



select so.name

from sysobjects so inner join syscolumns sc
ON so.id = sc.id where sc.name like '%supplier%'

Output like:

Find table name from Column Name

















above is list of Table that contain a column like Supplier.






No comments:

Post a Comment

Please leave a comment for this post