How to search for a table or column in all the databases in a server
Using T-SQL in SQL Server
To search for a table across databases in a server
EXEC sp_MSforeachdb
'SELECT "?" AS DB, *
FROM [?].sys.tables
WHERE name like ''%invoice%'''
Sample output:
To search for a column in tables across databases in a server
EXEC sp_MSforeachdb
'SELECT "?" AS DB, object_name(object_id,db_id("?")) as TableName, *
FROM [?].sys.all_columns
WHERE name like ''%invoice%'''