查询存储过程视图是否用到表和字段
select name from sysobjects as s inner join syscomments as o on s.id=o.id where text like N'%表名%字段名%'
--查询表字段SELECT OBJECT_NAME(object_id) '表名',name AS '列名称' FROM sys.columns