select name from sys.databases
declare @a varchar(max)=''
select @a=@a+'
if exists(select 1 from '+name+'.INFORMATION_SCHEMA.TABLES where TABLE_NAME=''emp'')
print ''emp in :'+name+char(39)
from sys.databases
exec(@a)
declare @a varchar(max)=''
select @a=@a+'
if exists(select 1 from '+name+'.INFORMATION_SCHEMA.TABLES where TABLE_NAME=''emp'')
print ''emp in :'+name+char(39)
from sys.databases
exec(@a)