查找表名是否存在于某个函数或者视图中:
select distinct object_name(id) from syscomments
where id in (select id from sysobjects where type in('V','P'))
and text like '%表名%'
本文介绍了一种SQL查询方法,用于检测特定表名是否存在于数据库的函数或视图中。通过使用syscomments和sysobjects系统表,可以有效地识别包含指定表名的所有函数和视图。
查找表名是否存在于某个函数或者视图中:
select distinct object_name(id) from syscomments
where id in (select id from sysobjects where type in('V','P'))
and text like '%表名%'
463
6540

被折叠的 条评论
为什么被折叠?