SQLserver 查询表是否被哪些存储过程和视图引用

1 被我引用的对象

SELECT * FROM sys.dm_sql_referenced_entities('TableName','OBJECT');

–查看依赖项
2 引用我的对象

SELECT * FROM sys.dm_sql_referencing_entities('TableName','OBJECT');

3 存储过程、视图引用

select distinct object_name(id) from syscomments where id in
(select id from sysobjects where type ='P') and text like '%表名%'
上一篇:No operator matches the given name and argument types. You might need to add explicit type casts


下一篇:Mysql 导出csv html xml 格式数据