SQL Server 查询当前数据库中所有包含某字段的表

select object_name(id) objName,Name as colName
from syscolumns
where (name like'%字段%')
and id in(select id from sysobjects where xtype='u')
order by objname

查询包所有包含关键字段的表

 

 

SELECT obj.Name 存储过程名, sc.TEXT 存储过程内容 
 
FROM syscomments sc 
 
INNER JOIN sysobjects obj ON sc.Id = obj.ID 
 
WHERE sc.TEXT LIKE '%字段%'  

查询存储过程

posted @ 2022-03-21 15:03  clown  阅读(761)  评论(0编辑  收藏  举报