I've seen something like this in SQL Server (running this query against the master database):
我在SQL Server中看到过类似的情况(在主数据库中运行这个查询):
select * from tempdb..sysobjects
which seems to return exactly the same results as:
似乎返回的结果与:
select * from tempdb.sys.objects
I've seen that the double dot can be used as a way to omit the schema name but I don't see anything omitted here, going by that logic then tempdb..objects
would be valid which is not).
我已经看到双点可以作为省略模式名的一种方式,但是我在这里没有看到任何遗漏,按照这个逻辑,然后是tempdb。对象是有效的,而不是)。
1 个解决方案
#1
3
tempdb..objects
will be interpretted as tempdb.dbo.objects
tempdb . .对象将被解释为tempdb.dbo.objects
Both are two different system views
两者都是不同的系统视图
sys.objects
Contains a row for each user-defined, schema-scoped object that is created within a database, including natively compiled scalar user-defined function.
包含在数据库中创建的每个用户定义、模式范围的对象的行,包括本机编译的标量用户定义函数。
sys.sysobjects
Contains one row for each object that is created within a database, such as a constraint, default, log, rule, and stored procedure
包含在数据库中创建的每个对象的一行,例如约束、默认、日志、规则和存储过程
Note : This SQL Server 2000 system table is included as a view for backward compatibility. We recommend that you use the current SQL Server system views instead. To find the equivalent system view or views, see Mapping System Tables to System Views (Transact-SQL). This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.
注意:这个SQL Server 2000系统表包含在向后兼容性视图中。我们建议您使用当前的SQL Server系统视图。要找到等效的系统视图或视图,请参见将系统表映射到系统视图(Transact-SQL)。这个特性将在未来的Microsoft SQL Server版本中被删除。避免在新的开发工作中使用该特性,并计划修改当前使用该特性的应用程序。
#1
3
tempdb..objects
will be interpretted as tempdb.dbo.objects
tempdb . .对象将被解释为tempdb.dbo.objects
Both are two different system views
两者都是不同的系统视图
sys.objects
Contains a row for each user-defined, schema-scoped object that is created within a database, including natively compiled scalar user-defined function.
包含在数据库中创建的每个用户定义、模式范围的对象的行,包括本机编译的标量用户定义函数。
sys.sysobjects
Contains one row for each object that is created within a database, such as a constraint, default, log, rule, and stored procedure
包含在数据库中创建的每个对象的一行,例如约束、默认、日志、规则和存储过程
Note : This SQL Server 2000 system table is included as a view for backward compatibility. We recommend that you use the current SQL Server system views instead. To find the equivalent system view or views, see Mapping System Tables to System Views (Transact-SQL). This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.
注意:这个SQL Server 2000系统表包含在向后兼容性视图中。我们建议您使用当前的SQL Server系统视图。要找到等效的系统视图或视图,请参见将系统表映射到系统视图(Transact-SQL)。这个特性将在未来的Microsoft SQL Server版本中被删除。避免在新的开发工作中使用该特性,并计划修改当前使用该特性的应用程序。