34,590
社区成员
发帖
与我相关
我的任务
分享
select * from databaseName.dbo.sysobjects where type='U' and name like '%node_001%'
USE test
GO
IF object_id('tempdb..#') IS NOT NULL
DROP TABLE #
CREATE TABLE # (databases sysname,tabels sysname)
--搜索所有數據庫
INSERT INTO #
EXEC sys.sp_MSforeachdb
@command1=N'select ''?'' as databases,name as tables from ?.sys.sysobjects where type=''U'' and name like ''%node_001%'''
SELECT * FROM #
IF object_id('tempdb..#') IS NOT NULL
DROP TABLE #
select * from databaseName.dbo.sysobjects where type='U' and name like '%node_001%'
--和楼上的区别是加上数据库名称
select * from sysobjects where type='U' and name like '%node_001%'
select * from sys.objects where type='U' and name like '%node_001%'
select * from sys.tables where name like '%node_001%'