Friday, April 27, 2012 11:13 AM
I have 1 database.. in that database im having 20 tables.. my question is i have one column but i don't know that column belongs to which table..
so how can i find that column belongs to which table?
Friday, April 27, 2012 11:21 AM
Pls try this
select Object_name(Object_ID) TableName,* from sys.columns where name ='ColumnName' ---Pls replace your column name
- Marked As Answer by Sagar129 Monday, April 30, 2012 6:32 AM
Friday, April 27, 2012 11:33 AMor:
select TABLE_SCHEMA, TABLE_NAME from information_schema.COLUMNS where COLUMN_NAME = 'mycolumnname'
SQL Server DBA
Please click "Propose As Answer" if a post solves your problem, or "Vote As Helpful" if a post has been useful to you
- Proposed As Answer by amber zhangModerator Monday, April 30, 2012 1:50 AM
Friday, April 27, 2012 7:15 PM
There are some free tools that may help as well. You can check out SQL Search by Red-Gate here: http://www.red-gate.com/products/sql-development/sql-search/