Below script helps you to find the DB name, Table when you know only column name and not sure about database and table name.
exec sp_msforeachdb 'select TABLE_CATALOG as DBName,TABLE_NAME,COLUMN_NAME
from [?].INFORMATION_SCHEMA.COLUMNS where COLUMN_NAME=
''Column Name'';'
No comments:
Post a Comment