SqlServer查询存储过程和视图是否用到表字段

 

查询存储过程视图是否用到表和字段

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

posted @ 2023-05-17 13:35  九五小刘  阅读(51)  评论(0编辑  收藏  举报