Find a Table on a SQL Server across all Databases – TechNet Articles – United States (English) – TechNet Wiki
Posted by jpluimers on 2020/10/13
Neither solution on [WayBack] Find a Table on a SQL Server across all Databases – TechNet Articles – United States (English) – TechNet Wiki is nice, but the most readable (though undocumented) works:
sp_MSforeachdb
'SELECT "?" AS DB, * FROM [?].sys.tables WHERE name like '
'%your_table_name%'
''
Similar solutions at:
- [WayBack] sql – Display all the names of databases containing particular table – Stack Overflow
- [WayBack] SQL SERVER – Find Table in Every Database of SQL Server – SQL Authority with Pinal Dave
–jeroen
Leave a Reply