다음을 통해 공유


AutoIdentityRange Property

Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.

The AutoIdentityRange property specifies whether to automatically assign an identity range to a table that has an identity column and is an article in a publication that allows queued updates. The identity range is assigned at both the Publisher and Subscriber.

구문

object
.
AutoIdentityRange [=value]

Parts

  • object
    An expression that evaluates to an object in the Applies To list
  • value
    TRUE or FALSE

Data Type

Boolean

Modifiable

Read/write when creating an article. Read-only when referencing an existing article.

Prototype (C/C++)

HRESULT GetAutoIdentityRange(LPBOOL pRetVal);
HRESULT SetAutoIdentityRange(BOOL NewValue);

주의

Assigning an automatic identity range helps avoid conflicts in identity column values when data is inserted at the Subscriber in merge replication, or in transactional replication that allows queued updates. The identity range specifies the maximum number of new rows that can be inserted into an identity column in a table at a Publisher or Subscriber before a new identity range must be allocated.

Use the PublisherIdentityRangeSize and SubscriberIdentityRangeSize properties to set identity range sizes. Use the IdentityRangeThreshold property to control when a new identity range is allocated. When the number of new rows reaches the percentage specified by IdentityRangeTreshold, the new range is allocated.

When the AutoIdentityRange property is set to TRUE, identity ranges can be assigned to an identity column that contains unique values within a table. Unique values in an identity column are assigned automatically when new rows are inserted into the target table at the Publisher or Subscriber.

To configure the use of automatic identity ranges

  1. Use the HasIdentityColumn property to determine whether a table has an identity column. If you are using AutoIdentityRange with a TransArticle2 object, use the AllowedQueuedTransactions property to determine whether the publication allows queued updates.

  2. If HasIdentityColumn returns TRUE (and if AllowedQueuedTransactions returns TRUE for a transactional publication), set AutoIdentityRange to TRUE.

  3. Use the PublisherIdentityRangeSize property to set the identity range size at the Publisher.

  4. Use the SubscriberIdentityRangeSize property to set the identity range size at the Subscriber.

  5. Use the IdentityRangeThreshold property to specify (as a percentage of a Publisher's or Subscriber's range size) when a new identity range is allocated.

    [!참고] If an application calls AutoIdentityRange on an instance of Microsoft SQL Server version 7.0, the constant, SQLDMO_E_SQL80ONLY, and the message "This property or method requires Microsoft SQL Server 2000 or later" are returned.

Applies To:

MergeArticle2 Object

TransArticle2 Object

참고 항목

참조

HasIdentityColumn Property
IdentityRangeThreshold Property
PublisherIdentityRangeSize Property
SubscriberIdentityRangeSize Property

도움말 및 정보

SQL Server 2005 지원 받기