sqlserver查询数据库中包含某个字段的所有表和所有存储过程
编程语言
2018-12-25 20:59:47
阅读次数: 0
1、查询包含某字段的所有表
1
2 3 4 5 6 |
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 ; |
2、查询包含某字段的所有存储过程
1 2 3 4 5 6 7 |
SELECT obj. Name 存储过程名, sc.TEXT 存储过程内容 FROM syscomments sc INNER JOIN sysobjects obj ON sc.Id = obj.ID WHERE sc.TEXT LIKE '%你要查询的字段名% |
转载自blog.csdn.net/dell17951/article/details/85246892