从快照数据库中检查查看依赖项

发布于 2025-02-06 16:32:49 字数 81 浏览 1 评论 0原文

我想找到所有在数据库中调用从快照数据库的视图的对象。 对于在数据库中创建的对象,可以使用视图依赖项选项。 有什么方法可以找到快照数据库中创建的视图?

I want to find all objects in which view from snapshot database is called in the database.
For objects created in the database, that is possible using View Dependencies option.
Is there any way to find that out for views created in snapshot database?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

何以畏孤独 2025-02-13 16:32:49

当然。我假设您想回答“视图引用什么对象?”的问题。您可以在以下查询中找到:

select referenced_schema_name, referenced_entity_name
from sys.sql_expression_dependencies
where referencing_id = object_id('HumanResources.vEmployee');

显然,humanResources.vemployee在您的视图中(我使用了Ventailing AdventureWorks2019数据库作为测试)。

Sure. I'm assuming that you want to answer the question "what objects does the view reference?". You can find that with the following query:

select referenced_schema_name, referenced_entity_name
from sys.sql_expression_dependencies
where referencing_id = object_id('HumanResources.vEmployee');

Obviously replace HumanResources.vEmployee with your view (I used the venerable AdventureWorks2019 database as a test).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文