查找一个server下还有某个表名的数据库名字...
declare @tableName nvarchar(255),@sql nvarchar(1000)
set @tableName=N'tb_1'
set @sql=N'use ? if exists(select 1 from sysobjects where id=object_id('''+@tableName+''')) print ''?'''
------
EXEC sp_msforeachdb '
USE [?]
IF OBJECT_ID(N''tb_1'') IS NOT NULL
PRINT N''?''
'