|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
find out which tables used a specific fieldhi, how to find out which tables used a specific field in one database?
Thanks. just replace 'YourColumn' with the field you are looking for
SELECT c.TABLE_NAME,* FROM INFORMATION_SCHEMA.COLUMNS c join INFORMATION_SCHEMA.TABLES t on c.TABLE_NAME =t.TABLE_NAME WHERE TABLE_TYPE ='BASE TABLE' -- leave this out if you need views also AND COLUMN_NAME ='YourColumn' http://sqlservercode.blogspot.com/ will this do?
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='your_column_name' hth, dean Show quote "js" <j*@someone.com> wrote in message news:e0Zeml$MGHA.1312@TK2MSFTNGP09.phx.gbl... > hi, how to find out which tables used a specific field in one database? > Thanks. > > > > |
|||||||||||||||||||||||