1、查询包含某字段的所有表
select object_name(id) objName,Name as colName
from syscolumns
where (name like'%aaa_name%')
and id in(select id from sysobjects where xtype='u')
order by objname
2、查询包含某字段的所有存储过程
SELECT obj.Name 存储过程名, sc.TEXT 存储过程内容
FROM syscomments sc
INNER JOIN sysobjects obj ON sc.Id = obj.ID
WHERE sc.TEXT LIKE '%aaa_name%'
3、查看视图或存储过程的定义
sp_helptext 'p_1'
sp_helptext 'v_1'
4、查看表的定义
sp_help 't_1'