SQL Server INFORMATION_SCHEMA 内容
在大多数RDBMS中,元模型是“自包含的”,这意味着我可以通过浏览元模型本身来找出元模型的模型。 SQL Server 似乎并非如此。我想做的是:
SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'INFORMATION_SCHEMA'
这样,我就可以发现 INFORMATION_SCHEMA
架构本身。
为了使 INFORMATION_SCHEMA
视图“自包含”,我是否必须配置任何授予/权限/登录设置?
In most RDBMS, the meta-model is "self contained", which means that I can find out the model of the meta-model by browsing the meta-model itself. This doesn't seem to be the case with SQL Server. What I want to do is this:
SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'INFORMATION_SCHEMA'
That way, I can discover the INFORMATION_SCHEMA
schema itself.
Is there any grant/permission/login setting that I have to configure in order to make the INFORMATION_SCHEMA
views be "self contained"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不要认为这是可能的。
INFORMATION_SCHEMA.TABLES
视图的定义是这样的,它从
sys.objects
中提取信息,但是这又不包含任何关于INFORMATION_SCHEMA
对象的信息。这些的元数据是通过 sys.system_objects 访问的。
Don't think this is possible.
The definition of the
INFORMATION_SCHEMA.TABLES
view isso it pulls its information from
sys.objects
however this in turn contains nothing about theINFORMATION_SCHEMA
objects.The metadata for these is accessed via
sys.system_objects
instead.您可以使用 sys.all_views
You can use sys.all_views