34,575
社区成员
发帖
与我相关
我的任务
分享
--以下可查出那些视图是依靠视图创建的
select * from sysobjects a where type='V'
and exists(select * from sysdepends b where id=a.id and
exists(select * from sysobjects where type='V' and id=b.depid))
--以下可查出视图与相关用于创建视图的名称
select object_name(id),object_name(depid) from sysdepends b where exists(select * from sysobjects where type='V' and id=b.depid)