[英]Wrong return value of OBJECT_ID?
On Microsoft SQL Server 2014 (SP2-CU1) (KB3178925) - 12.0.5511.0 (X64) Aug 19 2016 14:32:30 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1) (Hypervisor)
在Microsoft SQL Server 2014(SP2-CU1)(KB3178925)-12.0.5511.0(X64)2016年8月19日14:32:30版权所有(c)Windows NT 6.1(Build 7601)上的Microsoft Corporation Enterprise Edition(64位):包1)(管理程序)
with the sp_UpdateStats actually doesn't existing, the query : 使用sp_UpdateStats实际上不存在,查询:
SELECT OBJECT_ID('sp_UpdateStats')
returns the value : -838816646 返回值:-838816646
and 和
select * FROM sys.objects WHERE name='sp_UpdateStats'
return 0 line... 返回0行...
How can it be ? 怎么会这样 ? A bug in OBJECT_ID function ?
OBJECT_ID函数中的错误?
EDIT 编辑
it's good to know that the ID -838816646 is comming from sys.sysobjects or sys.system_objects but then the question more precisely is : 很高兴知道ID -838816646来自sys.sysobjects或sys.system_objects,但接下来的问题是:
It will be stored in Master
database sysobjects
view 它将存储在
Master
数据库sysobjects
视图中
select * FROM master.sys.sysobjects WHERE name='sp_UpdateStats'
Results : -838816646
结果:
-838816646
Use sys.all_objects
to include system objects. 使用
sys.all_objects
包含系统对象。
SELECT *
FROM sys.all_objects
WHERE NAME = 'sp_UpdateStats'
The definition for this is actually in the resource database. 对此的定义实际上在资源数据库中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.