sqlserver查询表是否有被视图引用
钢翼
编程
在开发过程中,如果我们有使用到视图,那么我们如果修改了表结构,一般我们都需要对应修改视图。视图太多,可以使用下面语句查询,避免遗漏。
select distinct object_name(id) from syscomments where id in (select id from sysobjects where type in('V','P')) and text like '%表名%'