查看表与视图的依赖

 alter function F_Get_DepentTable_Ralation
(
@table sysname
)
/*
查看表与视图的依赖
*/
returns table
as
return(
SELECT sysobjects.name AS 'view', sysobjects_1.name AS 'depend table'
FROM sysobjects INNER JOIN
      sysdepends ON sysobjects.id = sysdepends.id INNER JOIN
      sysobjects sysobjects_1 ON sysdepends.depid = sysobjects_1.id
WHERE (sysobjects.xtype = 'v') AND (sysobjects_1.name = @table)
GROUP BY sysobjects.name, sysobjects_1.name)
阅读更多
文章标签: table join function
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭