sp_restoremergeidentityrange (Transact-SQL)sp_restoremergeidentityrange (Transact-SQL)
适用于:Applies to: SQL ServerSQL Server(所有支持的版本)
SQL ServerSQL Server (all supported versions)
SQL ServerSQL Server(所有支持的版本)
SQL ServerSQL Server (all supported versions)
此存储过程用于更新标识范围分配。This stored procedure is used to update identity range assignments. 该存储过程可确保从备份还原发布服务器后,自动标识范围管理运行正常。It ensures that automatic identity range management functions properly after a Publisher has been restored from a backup. 此存储过程在发布服务器上对发布数据库执行。This stored procedure is executed at the Publisher on the publication database.
Transact-SQL 语法约定
Transact-SQL Syntax Conventions
语法Syntax
sp_restoremergeidentityrange [ [ @publication = ] 'publication' ]
[ , [ @article = ] 'article' ]
参数Arguments
[ @publication = ] 'publication'
发布的名称。[ @publication = ] 'publication'
Is the name of the publication. 发布 为 sysname,默认值为 all。publication is sysname, with default value of all. 如果指定了此参数,则只还原该发布的标识范围。When specified, only identity ranges for that publication are restored.
[ @article = ] 'article'
项目的名称。[ @article = ] 'article'
Is the name of the article. 项目 的值为 sysname,默认值为 all。article is sysname, with a default value of all. 如果指定了此参数,则只还原该项目的标识范围。When specified, only identity ranges for that article are restored.
返回代码值Return Code Values
0 (成功) 或 1 (失败) 0 (success) or 1 (failure)
备注Remarks
sp_restoremergeidentityrange 用于合并复制。sp_restoremergeidentityrange is used with merge replication.
sp_restoremergeidentityrange 从分发服务器获取最大标识范围分配信息,并更新使用自动标识范围管理的项目 MSmerge_identity_range_allocations (transact-sql)的 max_used 列中的值。sp_restoremergeidentityrange gets maximum identity range allocation information from the Distributor and updates values in the max_used column of MSmerge_identity_range_allocations (Transact-SQL) for the articles which use automatic identity range management.
权限Permissions
只有 sysadmin 固定服务器角色的成员或 db_owner 固定数据库角色的成员才能执行 sp_restoremergeidentityrange。Only members of the sysadmin fixed server role or db_owner fixed database role can execute sp_restoremergeidentityrange.
另请参阅See Also
sp_addmergearticle (Transact-sql) sp_addmergearticle (Transact-SQL)
sp_changemergearticle (Transact-SQL) sp_changemergearticle (Transact-SQL)
复制标识列Replicate Identity Columns