Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 2.46 KB

sp-restoremergeidentityrange-transact-sql.md

File metadata and controls

64 lines (45 loc) · 2.46 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_restoremergeidentityrange (Transact-SQL)
sp_restoremergeidentityrange ensures that automatic identity range management functions properly after a Publisher is restored from a backup.
markingmyname
maghan
randolphwest
08/22/2024
sql
replication
reference
sp_restoremergeidentityrange_TSQL
sp_restoremergeidentityrange
sp_restoremergeidentityrange
TSQL

sp_restoremergeidentityrange (Transact-SQL)

[!INCLUDE SQL Server]

This stored procedure is used to update identity range assignments. It ensures that automatic identity range management functions properly after a Publisher is restored from a backup. This stored procedure is executed at the Publisher on the publication database.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

sp_restoremergeidentityrange
    [ [ @publication = ] N'publication' ]
    [ , [ @article = ] N'article' ]
[ ; ]

Arguments

[ @publication = ] N'publication'

The name of the publication. @publication is sysname, with a default of all. When specified, only identity ranges for that publication are restored.

[ @article = ] N'article'

The name of the article. @article is sysname, with a default of all. When specified, only identity ranges for that article are restored.

Return code values

0 (success) or 1 (failure).

Remarks

sp_restoremergeidentityrange is used with merge replication.

sp_restoremergeidentityrange gets maximum identity range allocation information from the Distributor, and updates values in the max_used column of MSmerge_identity_range_allocations for the articles that use automatic identity range management.

Permissions

Only members of the sysadmin fixed server role or db_owner fixed database role can execute sp_restoremergeidentityrange.

Related content