The query below finds all databases in Azure SQL Database instance containing a particular table (the table name must include its schema name). In this case the table is dbo.BuildVersion.
select [name] as [database_name] from sys.databases where case when state_desc = 'ONLINE' then object_id(quotename([name]) + '.[dbo].[BuildVersion]', 'U') end is not null order by 1
- database_name - database names
- One row: represents one database
- Scope of rows: all databases containing the provided table schema and name
- Ordered by: database name
All databases containing the dbo.BuildVersion table.