查询某个数据库下所有用到某张数据表的数据库对象: 存储过程 或 视图
-- use YourDbName
declare @tblName varchar(100)='Feed'
select a.name,a.[type],b.[definition] from sys.all_objects a,sys.sql_modules b
where a.is_ms_shipped=0 and a.object_id = b.object_id and a.[type] in ('P','V','AF')
and b.[definition] like '%' + @tblName + '%'
order by a.[name] asc查询结果

本文详细介绍了如何通过SQL查询在指定数据库内查找使用了特定数据表(如'Feed')的存储过程(Procedure)、视图(View)及抽象函数(Abstract Function)。利用系统表和SQL模块的关联,实现高效的数据分析和管理。
2018

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



