OBJECTPROPERTY (Transact-SQL)OBJECTPROPERTY (Transact-SQL)

適用於: 是SQL Server 是Azure SQL Database 是Azure SQL 資料倉儲 是平行處理資料倉儲 APPLIES TO: yesSQL Server yesAzure SQL Database yesAzure SQL Data Warehouse yesParallel Data Warehouse

傳回目前資料庫中結構描述範圍物件的相關資訊。Returns information about schema-scoped objects in the current database. 如需結構描述範圍物件的清單,請參閱 sys.objects (Transact-SQL)For a list of schema-scoped objects, see sys.objects (Transact-SQL). 不是以結構描述為範圍的物件,如資料定義語言 (DDL) 觸發程序和事件通知,無法使用這項功能。This function cannot be used for objects that are not schema-scoped, such as data definition language (DDL) triggers and event notifications.

主題連結圖示 Transact-SQL 語法慣例Topic link icon Transact-SQL Syntax Conventions

語法Syntax

OBJECTPROPERTY ( id , property )   

引數Arguments

idid
這是代表目前資料庫中之物件識別碼的運算式。Is an expression that represents the ID of the object in the current database. idint,假設為目前資料庫內容中的結構描述範圍物件。id is int and is assumed to be a schema-scoped object in the current database context.

propertyproperty
這個運算式代表 id 指定的物件要傳回的資訊。property 可以是下列值之一。Is an expression that represents the information to be returned for the object specified by id. property can be one of the following values.

注意

除非另有說明,否則,當 property 不是有效屬性的名稱、id 不是有效的物件識別碼、id 對於指定的 property 是不支援的物件類型,或呼叫者無權檢視物件中繼資料時,便會傳回 NULL。Unless noted otherwise, NULL is returned when property is not a valid property name, id is not a valid object ID, id is an unsupported object type for the specified property, or the caller does not have permission to view the object's metadata.

屬性名稱Property name 物件類型Object type 描述和傳回的值Description and values returned
CnstIsClustKeyCnstIsClustKey 條件約束Constraint 含叢集索引的 PRIMARY KEY 條件約束。PRIMARY KEY constraint with a clustered index.

1 = True1 = True

0 = False0 = False
CnstIsColumnCnstIsColumn 條件約束Constraint 單一資料行的 CHECK、DEFAULT 或 FOREIGN KEY 條件約束。CHECK, DEFAULT, or FOREIGN KEY constraint on a single column.

1 = True1 = True

0 = False0 = False
CnstIsDeleteCascadeCnstIsDeleteCascade 條件約束Constraint 含 ON DELETE CASCADE 選項的 FOREIGN KEY 條件約束。FOREIGN KEY constraint with the ON DELETE CASCADE option.

1 = True1 = True

0 = False0 = False
CnstIsDisabledCnstIsDisabled 條件約束Constraint 停用的條件約束。Disabled constraint.

1 = True1 = True

0 = False0 = False
CnstIsNonclustKeyCnstIsNonclustKey 條件約束Constraint 含非叢集索引的 PRIMARY KEY 或 UNIQUE 條件約束。PRIMARY KEY or UNIQUE constraint with a nonclustered index.

1 = True1 = True

0 = False0 = False
CnstIsNotReplCnstIsNotRepl 條件約束Constraint 條件約束是利用 NOT FOR REPLICATION 關鍵字來定義的。Constraint is defined by using the NOT FOR REPLICATION keywords.

1 = True1 = True

0 = False0 = False
CnstIsNotTrustedCnstIsNotTrusted 條件約束Constraint 在不檢查現有資料列的情況下啟用條件約束;因此,條件約束並不適用於所有資料列。Constraint was enabled without checking existing rows; therefore, the constraint may not hold for all rows.

1 = True1 = True

0 = False0 = False
CnstIsUpdateCascadeCnstIsUpdateCascade 條件約束Constraint 含 ON UPDATE CASCADE 選項的 FOREIGN KEY 條件約束。FOREIGN KEY constraint with the ON UPDATE CASCADE option.

1 = True1 = True

0 = False0 = False
ExecIsAfterTriggerExecIsAfterTrigger 觸發程序Trigger AFTER 觸發程序。AFTER trigger.

1 = True1 = True

0 = False0 = False
ExecIsAnsiNullsOnExecIsAnsiNullsOn Transact-SQLTransact-SQL 函數、Transact-SQLTransact-SQL 程序、Transact-SQLTransact-SQL 觸發程序、檢視表function, Transact-SQLTransact-SQL procedure, Transact-SQLTransact-SQL trigger, view 建立期間的 ANSI_NULLS 設定。Setting of ANSI_NULLS at creation time.

1 = True1 = True

0 = False0 = False
ExecIsDeleteTriggerExecIsDeleteTrigger 觸發程序Trigger DELETE 觸發程序。DELETE trigger.

1 = True1 = True

0 = False0 = False
ExecIsFirstDeleteTriggerExecIsFirstDeleteTrigger 觸發程序Trigger 當執行資料表的 DELETE 作業時,所引發的第一個觸發程序。First trigger fired when a DELETE is executed against the table.

1 = True1 = True

0 = False0 = False
ExecIsFirstInsertTriggerExecIsFirstInsertTrigger 觸發程序Trigger 當執行資料表的 INSERT 作業時,所引發的第一個觸發程序。First trigger fired when an INSERT is executed against the table.

1 = True1 = True

0 = False0 = False
ExecIsFirstUpdateTriggerExecIsFirstUpdateTrigger 觸發程序Trigger 當執行資料表的 UPDATE 作業時,所引發的第一個觸發程序。First trigger fired when an UPDATE is executed against the table.

1 = True1 = True

0 = False0 = False
ExecIsInsertTriggerExecIsInsertTrigger 觸發程序Trigger INSERT 觸發程序。INSERT trigger.

1 = True1 = True

0 = False0 = False
ExecIsInsteadOfTriggerExecIsInsteadOfTrigger 觸發程序Trigger INSTEAD OF 觸發程序。INSTEAD OF trigger.

1 = True1 = True

0 = False0 = False
ExecIsLastDeleteTriggerExecIsLastDeleteTrigger 觸發程序Trigger 當執行資料表的 DELETE 作業時,所引發的最後一個觸發程序。Last trigger fired when a DELETE is executed against the table.

1 = True1 = True

0 = False0 = False
ExecIsLastInsertTriggerExecIsLastInsertTrigger 觸發程序Trigger 當執行資料表的 INSERT 作業時,所引發的最後一個觸發程序。Last trigger fired when an INSERT is executed against the table.

1 = True1 = True

0 = False0 = False
ExecIsLastUpdateTriggerExecIsLastUpdateTrigger 觸發程序Trigger 當執行資料表的 UPDATE 作業時,所引發的最後一個觸發程序。Last trigger fired when an UPDATE is executed against the table.

1 = True1 = True

0 = False0 = False
ExecIsQuotedIdentOnExecIsQuotedIdentOn Transact-SQLTransact-SQL 函數、Transact-SQLTransact-SQL 程序、Transact-SQLTransact-SQL 觸發程序、檢視表function, Transact-SQLTransact-SQL procedure, Transact-SQLTransact-SQL trigger, view 建立期間的 QUOTED_IDENTIFIER 設定。Setting of QUOTED_IDENTIFIER at creation time.

1 = True1 = True

0 = False0 = False
ExecIsStartupExecIsStartup 程序Procedure 啟動程序。Startup procedure.

1 = True1 = True

0 = False0 = False
ExecIsTriggerDisabledExecIsTriggerDisabled 觸發程序Trigger 停用的觸發程序。Disabled trigger.

1 = True1 = True

0 = False0 = False
ExecIsTriggerNotForReplExecIsTriggerNotForRepl 觸發程序Trigger 定義為 NOT FOR REPLICATION 的觸發程序。Trigger defined as NOT FOR REPLICATION.

1 = True1 = True

0 = False0 = False
ExecIsUpdateTriggerExecIsUpdateTrigger 觸發程序Trigger UPDATE 觸發程序。UPDATE trigger.

1 = True1 = True

0 = False0 = False
ExecIsWithNativeCompilationExecIsWithNativeCompilation Transact-SQLTransact-SQL 程序Procedure 適用於SQL Server 2014 (12.x)SQL Server 2014 (12.x)SQL Server 2017SQL Server 2017Applies to: SQL Server 2014 (12.x)SQL Server 2014 (12.x) through SQL Server 2017SQL Server 2017.

此為原生編譯的程序。Procedure is natively compiled.

1 = True1 = True

0 = False0 = False

基底資料類型:intBase data type: int
HasAfterTriggerHasAfterTrigger 資料表、檢視表Table, view 資料表或檢視表有 AFTER 觸發程序。Table or view has an AFTER trigger.

1 = True1 = True

0 = False0 = False
HasDeleteTriggerHasDeleteTrigger 資料表、檢視表Table, view 資料表或檢視表有 DELETE 觸發程序。Table or view has a DELETE trigger.

1 = True1 = True

0 = False0 = False
HasInsertTriggerHasInsertTrigger 資料表、檢視表Table, view 資料表或檢視表有 INSERT 觸發程序。Table or view has an INSERT trigger.

1 = True1 = True

0 = False0 = False
HasInsteadOfTriggerHasInsteadOfTrigger 資料表、檢視表Table, view 資料表或檢視表有 INSTEAD OF 觸發程序。Table or view has an INSTEAD OF trigger.

1 = True1 = True

0 = False0 = False
HasUpdateTriggerHasUpdateTrigger 資料表、檢視表Table, view 資料表或檢視表有 UPDATE 觸發程序。Table or view has an UPDATE trigger.

1 = True1 = True

0 = False0 = False
IsAnsiNullsOnIsAnsiNullsOn Transact-SQLTransact-SQL 函數、Transact-SQLTransact-SQL 程序、資料表、Transact-SQLTransact-SQL 觸發程序、檢視表function, Transact-SQLTransact-SQL procedure, table, Transact-SQLTransact-SQL trigger, view 指定資料表的 ANSI NULLS 選項設定是 ON。Specifies that the ANSI NULLS option setting for the table is ON. 這表示所有對於 Null 值的比較都會得出 UNKNOWN。This means all comparisons against a null value evaluate to UNKNOWN. 只要資料表存在,這項設定便適用於資料表定義中的所有運算式,其中包括計算資料行和條件約束。This setting applies to all expressions in the table definition, including computed columns and constraints, for as long as the table exists.

1 = True1 = True

0 = False0 = False
IsCheckCnstIsCheckCnst 任何結構描述範圍物件Any schema-scoped object CHECK 條件約束。CHECK constraint.

1 = True1 = True

0 = False0 = False
IsConstraintIsConstraint 任何結構描述範圍物件Any schema-scoped object 這是資料行或資料表的單一資料行 CHECK、DEFAULT 或 FOREIGN KEY 條件約束。Is a single column CHECK, DEFAULT, or FOREIGN KEY constraint on a column or table.

1 = True1 = True

0 = False0 = False
IsDefaultIsDefault 任何結構描述範圍物件Any schema-scoped object 適用於SQL Server 2008SQL Server 2008SQL Server 2017SQL Server 2017Applies to: SQL Server 2008SQL Server 2008 through SQL Server 2017SQL Server 2017.

繫結預設值。Bound default.

1 = True1 = True

0 = False0 = False
IsDefaultCnstIsDefaultCnst 任何結構描述範圍物件Any schema-scoped object DEFAULT 條件約束。DEFAULT constraint.

1 = True1 = True

0 = False0 = False
IsDeterministicIsDeterministic 函數、檢視表Function, view 函數或檢視表的決定性屬性。The determinism property of the function or view.

1 = 具有決定性1 = Deterministic

0 = 不具決定性0 = Not Deterministic
IsEncryptedIsEncrypted Transact-SQLTransact-SQL 函數、Transact-SQLTransact-SQL 程序、資料表、Transact-SQLTransact-SQL 觸發程序、檢視表function, Transact-SQLTransact-SQL procedure, table, Transact-SQLTransact-SQL trigger, view 指出此模組陳述式的原始文字已轉換為混亂格式。Indicates that the original text of the module statement was converted to an obfuscated format. SQL Server 2005 (9.x)SQL Server 2005 (9.x) 中,無法直接從任何目錄檢視中看見混亂格式的輸出。The output of the obfuscation is not directly visible in any of the catalog views in SQL Server 2005 (9.x)SQL Server 2005 (9.x). 對系統資料表或資料庫檔案沒有存取權的使用者,將無法擷取模糊化的文字。Users without access to system tables or database files cannot retrieve the obfuscated text. 不過,可以透過 DAC 通訊埠存取系統資料表,或直接存取資料庫檔案的使用者,則可使用該文字。However, the text is available to users that can either access system tables over the DAC port or directly access database files. 另外,可將偵錯工具附加至伺服器處理序的使用者,可以在執行階段從記憶體擷取原始程序。Also, users that can attach a debugger to the server process can retrieve the original procedure from memory at run time.

1 = 已加密1 = Encrypted

0 = 未加密0 = Not encrypted

基底資料類型:intBase data type: int
IsExecutedIsExecuted 任何結構描述範圍物件Any schema-scoped object 可以執行物件 (檢視、程序、函數或觸發程序)。Object can be executed (view, procedure, function, or trigger).

1 = True1 = True

0 = False0 = False
IsExtendedProcIsExtendedProc 任何結構描述範圍物件Any schema-scoped object 擴充程序。Extended procedure.

1 = True1 = True

0 = False0 = False
IsForeignKeyIsForeignKey 任何結構描述範圍物件Any schema-scoped object FOREIGN KEY 條件約束。FOREIGN KEY constraint.

1 = True1 = True

0 = False0 = False
IsIndexedIsIndexed 資料表、檢視表Table, view 有索引的資料表或檢視。Table or view that has an index.

1 = True1 = True

0 = False0 = False
IsIndexableIsIndexable 資料表、檢視表Table, view 可以建立索引的資料表或檢視。Table or view on which an index can be created.

1 = True1 = True

0 = False0 = False
IsInlineFunctionIsInlineFunction 函數Function 內嵌函數。Inline function.

1 = 內嵌函數1 = Inline function

0 = 非內嵌函數0 = Not inline function
IsMSShippedIsMSShipped 任何結構描述範圍物件Any schema-scoped object 在安裝 SQL ServerSQL Server 期間所建立的物件。Object created during installation of SQL ServerSQL Server.

1 = True1 = True

0 = False0 = False
IsPrimaryKeyIsPrimaryKey 任何結構描述範圍物件Any schema-scoped object PRIMARY KEY 條件約束。PRIMARY KEY constraint.

1 = True1 = True

0 = False0 = False

NULL = 不是函數,或物件識別碼無效。NULL = Not a function, or object ID is not valid.
IsProcedureIsProcedure 任何結構描述範圍物件Any schema-scoped object 程序。Procedure.

1 = True1 = True

0 = False0 = False
IsQuotedIdentOnIsQuotedIdentOn Transact-SQLTransact-SQL 函數、Transact-SQLTransact-SQL 程序、資料表、Transact-SQLTransact-SQL 觸發程序、檢視、CHECK 條件約束、DEFAULT 定義function, Transact-SQLTransact-SQL procedure, table, Transact-SQLTransact-SQL trigger, view, CHECK constraint, DEFAULT definition 指定物件含引號的識別碼設定是 ON。Specifies that the quoted identifier setting for the object is ON. 這表示用雙引號來分隔物件定義所涉及的所有運算式中之識別碼。This means double quotation marks delimit identifiers in all expressions involved in the object definition.

1 = ON1 = ON

0 = OFF0 = OFF
IsQueueIsQueue 任何結構描述範圍物件Any schema-scoped object Service Broker 佇列Service Broker Queue

1 = True1 = True

0 = False0 = False
IsReplProcIsReplProc 任何結構描述範圍物件Any schema-scoped object 複寫程序。Replication procedure.

1 = True1 = True

0 = False0 = False
IsRuleIsRule 任何結構描述範圍物件Any schema-scoped object 繫結規則。Bound rule.

1 = True1 = True

0 = False0 = False
IsScalarFunctionIsScalarFunction 函數Function 純量值函式。Scalar-valued function.

1 = 純量值函式1 = Scalar-valued function

0 = 非純量值函式0 = Not scalar-valued function
IsSchemaBoundIsSchemaBound 函數、檢視表Function, view 利用 SCHEMABINDING 來建立的結構描述繫結函數或檢視表。A schema bound function or view created by using SCHEMABINDING.

1 = 結構描述繫結1 = Schema-bound

0 = 非結構描述繫結。0 = Not schema-bound.
IsSystemTableIsSystemTable TableTable 系統資料表。System table.

1 = True1 = True

0 = False0 = False
IsSystemVerifiedIsSystemVerified ObjectObject SQL Server 可以驗證物件的決定性和有效位數屬性。SQL Server can verify the determinism and precision properties of the object.

1 = True1 = True

0 = False0 = False
IsTableIsTable TableTable 資料表。Table.

1 = True1 = True

0 = False0 = False
IsTableFunctionIsTableFunction 函數Function 資料表值函式。Table-valued function.

1 = 資料表值函式1 = Table-valued function

0 = 非資料表值函式0 = Not table-valued function
IsTriggerIsTrigger 任何結構描述範圍物件Any schema-scoped object 觸發程序。Trigger.

1 = True1 = True

0 = False0 = False
IsUniqueCnstIsUniqueCnst 任何結構描述範圍物件Any schema-scoped object UNIQUE 條件約束。UNIQUE constraint.

1 = True1 = True

0 = False0 = False
IsUserTableIsUserTable TableTable 使用者自訂資料表。User-defined table.

1 = True1 = True

0 = False0 = False
IsViewIsView 檢視View 檢視表。View.

1 = True1 = True

0 = False0 = False
OwnerIdOwnerId 任何結構描述範圍物件Any schema-scoped object 物件的擁有者。Owner of the object.

注意: 結構描述擁有者不一定是物件擁有者。Note: The schema owner is not necessarily the object owner. 例如,子物件 (其 parent_object_id 非 Null) 一律會傳回與父系相同的擁有者識別碼。For example, child objects (those where parent_object_id is nonnull) will always return the same owner ID as the parent.

非 Null = 物件擁有者的資料庫使用者識別碼。Nonnull = The database user ID of the object owner.
SchemaIdSchemaId 任何結構描述範圍物件Any schema-scoped object 這是物件所屬結構描述的結構描述識別碼。Schema ID of the schema to which the object belongs.
TableDeleteTriggerTableDeleteTrigger TableTable 資料表有 DELETE 觸發程序。Table has a DELETE trigger.

>1 = 屬於指定類型的第一個觸發程序識別碼。>1 = ID of first trigger with the specified type.
TableDeleteTriggerCountTableDeleteTriggerCount TableTable 資料表有指定數目的 DELETE 觸發程序。Table has the specified number of DELETE triggers.

>0 = DELETE 觸發程序的數目。>0 = The number of DELETE triggers.
TableFullTextMergeStatusTableFullTextMergeStatus TableTable 適用於SQL Server 2008SQL Server 2008SQL Server 2017SQL Server 2017Applies to: SQL Server 2008SQL Server 2008 through SQL Server 2017SQL Server 2017.

資料表是否具有目前正在合併的全文檢索索引。Whether a table that has a full-text index that is currently in merging.

0 = 資料表沒有全文檢索索引,或是全文檢索索引並未合併。0 = Table does not have a full-text index, or the full-text index is not in merging.

1 = 全文檢索索引正在合併。1 = The full-text index is in merging.
TableFullTextBackgroundUpdateIndexOnTableFullTextBackgroundUpdateIndexOn TableTable 適用於SQL Server 2008SQL Server 2008SQL Server 2017SQL Server 2017Applies to: SQL Server 2008SQL Server 2008 through SQL Server 2017SQL Server 2017.

資料表啟用全文檢索背景更新索引 (自動變更追蹤)。Table has full-text background update index (autochange tracking) enabled.

1 = TRUE1 = TRUE

0 = FALSE0 = FALSE
TableFulltextCatalogIdTableFulltextCatalogId TableTable 適用於SQL Server 2008SQL Server 2008SQL Server 2017SQL Server 2017Applies to: SQL Server 2008SQL Server 2008 through SQL Server 2017SQL Server 2017.

資料表的全文檢索索引資料所在的全文檢索目錄識別碼。ID of the full-text catalog in which the full-text index data for the table resides.

非零 = 全文檢索目錄識別碼,關聯於用來識別全文檢索索引資料表中的資料列之唯一索引。Nonzero = Full-text catalog ID, associated with the unique index that identifies the rows in a full-text indexed table.

0 = 資料表沒有全文檢索索引。0 = Table does not have a full-text index.
TableFulltextChangeTrackingOnTableFulltextChangeTrackingOn TableTable 適用於SQL Server 2008SQL Server 2008SQL Server 2017SQL Server 2017Applies to: SQL Server 2008SQL Server 2008 through SQL Server 2017SQL Server 2017.

資料表啟用全文檢索變更追蹤。Table has full-text change-tracking enabled.

1 = TRUE1 = TRUE

0 = FALSE0 = FALSE
TableFulltextDocsProcessedTableFulltextDocsProcessed TableTable 適用於SQL Server 2008SQL Server 2008SQL Server 2017SQL Server 2017Applies to: SQL Server 2008SQL Server 2008 through SQL Server 2017SQL Server 2017.

全文檢索索引啟動之後所處理的資料列數。Number of rows processed since the start of full-text indexing. 在建立全文檢索搜尋索引的資料表中,單一資料列的所有資料行都會被視為單一文件的一部分來建立索引。In a table that is being indexed for full-text search, all the columns of one row are considered as part of one document to be indexed.

0 = 沒有使用中的搜耙,或全文檢索索引已完成。0 = No active crawl or full-text indexing is completed.

> 0 = 下列其中之一 (A 或 B):A) 自啟動「完整」、「累加」或「手動」變更追蹤擴展之後,插入或更新作業所處理的文件數目。> 0 = One of the following (A or B): A) The number of documents processed by insert or update operations since the start of Full, Incremental, or Manual change tracking population. B) 啟用含背景更新索引母體擴展的變更追蹤、變更全文檢索索引結構描述、重建全文檢索目錄,或重新啟動 SQL ServerSQL Server 執行個體等作業之後,插入或更新作業所處理的資料列數。B) The number of rows processed by insert or update operations since change tracking with background update index population was enabled, the full-text index schema changed, the full-text catalog rebuilt, or the instance of SQL ServerSQL Server restarted, and so on.

NULL = 資料表沒有全文檢索索引。NULL = Table does not have a full-text index.

這個屬性不會監視或計算已刪除的資料列。This property does not monitor or count deleted rows.
TableFulltextFailCountTableFulltextFailCount TableTable 適用於SQL Server 2008SQL Server 2008SQL Server 2017SQL Server 2017Applies to: SQL Server 2008SQL Server 2008 through SQL Server 2017SQL Server 2017.

全文檢索搜尋未建立索引的資料列數。Number of rows Full-Text Search did not index.

0 = 母體擴展已完成。0 = The population has completed.

> 0 = 下列其中之一 (A 或 B):A) 自啟動「完整」、「累加」或「手動」更新變更追蹤擴展之後,尚未編製索引的文件數目。> 0 = One of the following (A or B): A) The number of documents that were not indexed since the start of Full, Incremental, and Manual Update change tracking population. B) 對於背景更新索引的變更追蹤,在開始母體擴展或重新開始母體擴展之後,尚未建立索引的資料列數。B) For change tracking with background update index, the number of rows that were not indexed since the start of the population, or the restart of the population. 這可能是結構描述變更、重建目錄、伺服器重新啟動等所造成的。This could be caused by a schema change, rebuild of the catalog, server restart, and so on.

NULL = 資料表沒有全文檢索索引。NULL = Table does not have a full-text index.
TableFulltextItemCountTableFulltextItemCount TableTable 適用於SQL Server 2008SQL Server 2008SQL Server 2017SQL Server 2017Applies to: SQL Server 2008SQL Server 2008 through SQL Server 2017SQL Server 2017.

已順利建立全文檢索索引的資料列數。Number of rows that were successfully full-text indexed.
TableFulltextKeyColumnTableFulltextKeyColumn TableTable 適用於SQL Server 2008SQL Server 2008SQL Server 2017SQL Server 2017Applies to: SQL Server 2008SQL Server 2008 through SQL Server 2017SQL Server 2017.

參與全文檢索索引定義之單一資料行唯一索引的相關資料行識別碼。ID of the column associated with the single-column unique index that is participating in the full-text index definition.

0 = 資料表沒有全文檢索索引。0 = Table does not have a full-text index.
TableFulltextPendingChangesTableFulltextPendingChanges TableTable 適用於SQL Server 2008SQL Server 2008SQL Server 2017SQL Server 2017Applies to: SQL Server 2008SQL Server 2008 through SQL Server 2017SQL Server 2017.

要處理的暫止變更追蹤項目數。Number of pending change tracking entries to process.

0 = 未啟用變更追蹤。0 = change tracking is not enabled.

NULL = 資料表沒有全文檢索索引。NULL = Table does not have a full-text index.
TableFulltextPopulateStatusTableFulltextPopulateStatus TableTable 適用於SQL Server 2008SQL Server 2008SQL Server 2017SQL Server 2017Applies to: SQL Server 2008SQL Server 2008 through SQL Server 2017SQL Server 2017.

0 = 閒置。0 = Idle.

1 = 完整母體擴展在進行中。1 = Full population is in progress.

2 = 累加母體擴展在進行中。2 = Incremental population is in progress.

3 = 追蹤變更的傳播在進行中。3 = Propagation of tracked changes is in progress.

4 = 背景更新索引在進行中,如自動變更追蹤。4 = Background update index is in progress, such as autochange tracking.

5 = 全文檢索索引在調整執行速度或暫停。5 = Full-text indexing is throttled or paused.
TableHasActiveFulltextIndexTableHasActiveFulltextIndex TableTable 適用於SQL Server 2008SQL Server 2008SQL Server 2017SQL Server 2017Applies to: SQL Server 2008SQL Server 2008 through SQL Server 2017SQL Server 2017.

資料表有使用中的全文檢索索引。Table has an active full-text index.

1 = True1 = True

0 = False0 = False
TableHasCheckCnstTableHasCheckCnst TableTable 資料表有 CHECK 條件約束。Table has a CHECK constraint.

1 = True1 = True

0 = False0 = False
TableHasClustIndexTableHasClustIndex TableTable 資料表有叢集索引。Table has a clustered index.

1 = True1 = True

0 = False0 = False
TableHasDefaultCnstTableHasDefaultCnst TableTable 資料表有 DEFAULT 條件約束。Table has a DEFAULT constraint.

1 = True1 = True

0 = False0 = False
TableHasDeleteTriggerTableHasDeleteTrigger TableTable 資料表有 DELETE 觸發程序。Table has a DELETE trigger.

1 = True1 = True

0 = False0 = False
TableHasForeignKeyTableHasForeignKey TableTable 資料表有 FOREIGN KEY 條件約束。Table has a FOREIGN KEY constraint.

1 = True1 = True

0 = False0 = False
TableHasForeignRefTableHasForeignRef TableTable 資料表由 FOREIGN KEY 條件約束參考。Table is referenced by a FOREIGN KEY constraint.

1 = True1 = True

0 = False0 = False
TableHasIdentityTableHasIdentity TableTable 資料表有識別欄位。Table has an identity column.

1 = True1 = True

0 = False0 = False
TableHasIndexTableHasIndex TableTable 資料表有任何類型的索引。Table has an index of any type.

1 = True1 = True

0 = False0 = False
TableHasInsertTriggerTableHasInsertTrigger TableTable 物件有 INSERT 觸發程序。Object has an INSERT trigger.

1 = True1 = True

0 = False0 = False
TableHasNonclustIndexTableHasNonclustIndex TableTable 資料表有非叢集索引。Table has a nonclustered index.

1 = True1 = True

0 = False0 = False
TableHasPrimaryKeyTableHasPrimaryKey TableTable 資料表有主索引鍵。Table has a primary key.

1 = True1 = True

0 = False0 = False
TableHasRowGuidColTableHasRowGuidCol TableTable 資料表有 uniqueidentifier 資料行的 ROWGUIDCOL。Table has a ROWGUIDCOL for a uniqueidentifier column.

1 = True1 = True

0 = False0 = False
TableHasTextImageTableHasTextImage TableTable 資料表有 textntextimage 資料行。Table has a text, ntext, or image column.

1 = True1 = True

0 = False0 = False
TableHasTimestampTableHasTimestamp TableTable 資料表有 timestamp 資料行。Table has a timestamp column.

1 = True1 = True

0 = False0 = False
TableHasUniqueCnstTableHasUniqueCnst TableTable 資料表有 UNIQUE 條件約束。Table has a UNIQUE constraint.

1 = True1 = True

0 = False0 = False
TableHasUpdateTriggerTableHasUpdateTrigger TableTable 物件有 UPDATE 觸發程序。Object has an UPDATE trigger.

1 = True1 = True

0 = False0 = False
TableHasVarDecimalStorageFormatTableHasVarDecimalStorageFormat TableTable 資料表可使用 vardecimal 儲存格式。Table is enabled for vardecimal storage format.

1 = True1 = True

0 = False0 = False
TableInsertTriggerTableInsertTrigger TableTable 資料表有 INSERT 觸發程序。Table has an INSERT trigger.

>1 = 屬於指定類型的第一個觸發程序識別碼。>1 = ID of first trigger with the specified type.
TableInsertTriggerCountTableInsertTriggerCount TableTable 資料表有指定數目的 INSERT 觸發程序。Table has the specified number of INSERT triggers.

>0 = INSERT 觸發程序的數目。>0 = The number of INSERT triggers.
TableIsFakeTableIsFake TableTable 資料表不是真正的資料表。Table is not real. SQL Server Database EngineSQL Server Database Engine 在內部視需要而將它具體化。It is materialized internally on demand by the SQL Server Database EngineSQL Server Database Engine.

1 = True1 = True

0 = False0 = False
TableIsLockedOnBulkLoadTableIsLockedOnBulkLoad TableTable 資料表因 bcp 或 BULK INSERT 作業而鎖定。Table is locked due to a bcp or BULK INSERT job.

1 = True1 = True

0 = False0 = False
TableIsMemoryOptimizedTableIsMemoryOptimized TableTable 適用於SQL Server 2014 (12.x)SQL Server 2014 (12.x)SQL Server 2017SQL Server 2017Applies to: SQL Server 2014 (12.x)SQL Server 2014 (12.x) through SQL Server 2017SQL Server 2017.

資料表是記憶體最佳化的Table is memory optimized

1 = True1 = True

0 = False0 = False

基底資料類型:intBase data type: int

如需詳細資訊,請參閱記憶體內部 OLTP (記憶體內部最佳化)For more information, see In-Memory OLTP (In-Memory Optimization).
TableIsPinnedTableIsPinned TableTable 資料表固定保留在資料快取中。Table is pinned to be held in the data cache.

0 = False0 = False

SQL Server 2005 (9.x)SQL Server 2005 (9.x) 及更新版本中不支援這項功能。This feature is not supported in SQL Server 2005 (9.x)SQL Server 2005 (9.x) and later.
TableTextInRowLimitTableTextInRowLimit TableTable text in row 所允許的最大位元組數目。Maximum bytes allowed for text in row.

如果未設定 text in row 選項,便是 0。0 if text in row option is not set.
TableUpdateTriggerTableUpdateTrigger TableTable 資料表有 UPDATE 觸發程序。Table has an UPDATE trigger.

>1 = 具有指定類型之第一個觸發程序的識別碼。> 1 = ID of first trigger with the specified type.
TableUpdateTriggerCountTableUpdateTriggerCount TableTable 資料表有指定數目的 UPDATE 觸發程序。The table has the specified number of UPDATE triggers.

>0 = UPDATE 觸發程序的數目。> 0 = The number of UPDATE triggers.
TableHasColumnSetTableHasColumnSet TableTable 資料表有資料行集。Table has a column set.

0 = False0 = False

1 = True1 = True

如需詳細資訊,請參閱 使用資料行集For more information, see Use Column Sets.
TableTemporalTypeTableTemporalType TableTable 適用於SQL Server 2016 (13.x)SQL Server 2016 (13.x)SQL Server 2017SQL Server 2017Applies to: SQL Server 2016 (13.x)SQL Server 2016 (13.x) through SQL Server 2017SQL Server 2017.

指定資料表的類型。Specifies the type of table.

0 = 非時態表0 = non-temporal table

1 = 系統版本設定資料表的記錄資料表1 = history table for system-versioned table

2 = 系統版本設定的時態表2 = system-versioned temporal table

傳回類型Return Types

intint

例外狀況Exceptions

當發生錯誤,或呼叫端沒有檢視物件的權限時,便會傳回 NULL。Returns NULL on error or if a caller does not have permission to view the object.

使用者只能檢視使用者擁有或被授與某些權限之安全性實體的中繼資料。A user can only view the metadata of securables that the user owns or on which the user has been granted permission. 這表示發出中繼資料的內建函數 (例如,OBJECTPROPERTY) 會在使用者不具有該物件任何權限時傳回 NULL。This means that metadata-emitting, built-in functions such as OBJECTPROPERTY may return NULL if the user does not have any permission on the object. 如需相關資訊,請參閱 Metadata Visibility ConfigurationFor more information, see Metadata Visibility Configuration.

RemarksRemarks

Database EngineDatabase Engine 假設 object_id 在目前資料庫內容中。The Database EngineDatabase Engine assumes that object_id is in the current database context. 參考另一資料庫中之 object_id 的查詢會傳回 NULL 或不正確的結果。A query that references an object_id in another database will return NULL or incorrect results. 例如,在下列查詢中,目前資料庫內容是 master 資料庫。For example, in the following query the current database context is the master database. Database EngineDatabase Engine 會嘗試傳回該資料庫中指定之 object_id 的屬性值,而不是查詢中所指定的資料庫。The Database EngineDatabase Engine will try to return the property value for the specified object_id in that database instead of the database specified in the query. 查詢會傳回不正確的結果,因為 vEmployee 檢視表不在 master 資料庫中。The query returns incorrect results because the view vEmployee is not in the master database.

USE master;  
GO  
SELECT OBJECTPROPERTY(OBJECT_ID(N'AdventureWorks2012.HumanResources.vEmployee'), 'IsView');  
GO  

OBJECTPROPERTY(view_id, 'IsIndexable') 可能耗用大量電腦資源,因為評估 IsIndexable 屬性需要剖析檢視定義、正規化和部分最佳化。OBJECTPROPERTY(view_id, 'IsIndexable') may consume significant computer resources because evaluation of IsIndexable property requires the parsing of view definition, normalization, and partial optimization. 雖然 IsIndexable 屬性會識別能夠建立索引的資料表或檢視表,但如果不符合特定索引鍵需求,實際建立索引的作業仍可能失敗。Although the IsIndexable property identifies tables or views that can be indexed, the actual creation of the index still might fail if certain index key requirements are not met. 如需詳細資訊,請參閱 CREATE INDEX (Transact-SQL)For more information, see CREATE INDEX (Transact-SQL).

當至少加入資料表的一個資料行來建立索引時,OBJECTPROPERTY(table_id, 'TableHasActiveFulltextIndex') 會傳回 1 (true) 這個值。OBJECTPROPERTY(table_id, 'TableHasActiveFulltextIndex') will return a value of 1 (true) when at least one column of a table is added for indexing. 只要加入第一個用來建立索引的資料行,全文檢索索引作業就會成為使用中,以便擴展。Full-text indexing becomes active for population as soon as the first column is added for indexing.

當建立資料表時,一律會在資料表的中繼資料中,將 QUOTED IDENTIFIER 選項儲存成 ON,即使建立資料表時將選項設成 OFF,也是如此。When a table is created, the QUOTED IDENTIFIER option is always stored as ON in the metadata of the table, even if the option is set to OFF when the table is created. 因此,OBJECTPROPERTY(table_id, 'IsQuotedIdentOn') 一律會傳回 1 (true) 這個值。Therefore, OBJECTPROPERTY(table_id, 'IsQuotedIdentOn') will always return a value of 1 (true).

範例Examples

A.A. 確認物件是資料表Verifying that an object is a table

下列範例會測試 UnitMeasure 是否為 AdventureWorks2012AdventureWorks2012 資料庫中的資料表。The following example tests whether UnitMeasure is a table in the AdventureWorks2012AdventureWorks2012 database.

USE AdventureWorks2012;  
GO  
IF OBJECTPROPERTY (OBJECT_ID(N'Production.UnitMeasure'),'ISTABLE') = 1  
   PRINT 'UnitMeasure is a table.'  
ELSE IF OBJECTPROPERTY (OBJECT_ID(N'Production.UnitMeasure'),'ISTABLE') = 0  
   PRINT 'UnitMeasure is not a table.'  
ELSE IF OBJECTPROPERTY (OBJECT_ID(N'Production.UnitMeasure'),'ISTABLE') IS NULL  
   PRINT 'ERROR: UnitMeasure is not a valid object.';  
GO  
  

B.B. 確認純量值使用者定義函數具決定性Verifying that a scalar-valued user-defined function is deterministic

下列範例會測試使用者定義的純量值函式 ufnGetProductDealerPrice (會傳回 money 值) 是否具確定性。The following example tests whether the user-defined scalar-valued function ufnGetProductDealerPrice, which returns a money value, is deterministic.

USE AdventureWorks2012;  
GO  
SELECT OBJECTPROPERTY(OBJECT_ID('dbo.ufnGetProductDealerPrice'), 'IsDeterministic');  
GO  

結果集會顯示 ufnGetProductDealerPrice 不是具決定性的函數。The result set shows that ufnGetProductDealerPrice is not a deterministic function.

-----  
0

C.尋找屬於特定結構描述的資料表C: Finding the tables that belong to a specific schema

下列範例會傳回 dbo 結構描述中的所有資料表。The following example returns all the tables in the dbo schema.

-- Uses AdventureWorks  
  
SELECT name, object_id, type_desc  
FROM sys.objects   
WHERE OBJECTPROPERTY(object_id, N'SchemaId') = SCHEMA_ID(N'dbo')  
ORDER BY type_desc, name;  
GO  

範例:Azure SQL 資料倉儲Azure SQL Data Warehouse平行處理資料倉儲Parallel Data WarehouseExamples: Azure SQL 資料倉儲Azure SQL Data Warehouse and 平行處理資料倉儲Parallel Data Warehouse

D.確認物件是資料表D: Verifying that an object is a table

下列範例會測試 dbo.DimReseller 是否為 AdventureWorksPDW2012AdventureWorksPDW2012 資料庫中的資料表。The following example tests whether dbo.DimReseller is a table in the AdventureWorksPDW2012AdventureWorksPDW2012 database.

-- Uses AdventureWorks  
  
IF OBJECTPROPERTY (OBJECT_ID(N'dbo.DimReseller'),'ISTABLE') = 1  
   SELECT 'DimReseller is a table.'  
ELSE   
   SELECT 'DimReseller is not a table.';  
GO  

另請參閱See Also

COLUMNPROPERTY (Transact-SQL) COLUMNPROPERTY (Transact-SQL)
中繼資料函數 (Transact-SQL) Metadata Functions (Transact-SQL)
OBJECTPROPERTYEX (Transact-SQL) OBJECTPROPERTYEX (Transact-SQL)
ALTER AUTHORIZATION (Transact-SQL) ALTER AUTHORIZATION (Transact-SQL)
TYPEPROPERTY (Transact-SQL) TYPEPROPERTY (Transact-SQL)
sys.objects (Transact-SQL)sys.objects (Transact-SQL)