• Cheers, I got round this by setting the Auto value to Manual and then setting the pub range, ident range and threshold.

    Heres the code, hopefully it will help someone else.

    USE [DB]

    CREATE TABLE #tempSysMergeArticles

    (

    [tableName] [varchar](255) NOT NULL,

    [Row] [int] IDENTITY(1,1) NOT NULL

    )

    DECLARE @intLoop int

    DECLARE @tableName varchar(255), @replication_publication varchar(255), @value_option varchar(255)

    DECLARE @value_pub_identity_range int, @value_identity_range int, @value_threshold int

    SET @replication_publication = 'DBMerge'

    SET @value_pub_identity_range = 1000000

    SET @value_identity_range = 2000

    SET @value_threshold = 80

    SET @value_option = 'manual'

    INSERT INTO #tempSysMergeArticles

    (

    [tableName]

    )

    (

    select [name]

    from dbo.sysmergearticles

    WHERE [identity_support] = 1

    )

    set @intLoop = 0

    while (@intLoop < (SELECT MAX([Row]) FROM #tempSysMergeArticles))

    begin

    set @intLoop = @intLoop + 1

    set @tableName = (SELECT [tableName] FROM #tempSysMergeArticles WHERE [Row] = @intLoop)

    exec sp_changemergearticle

    @publication = @replication_publication,

    @article = @tableName,

    @property = N'pub_identity_range',

    @value = @value_pub_identity_range,

    @force_invalidate_snapshot = 1,

    @force_reinit_subscription = 1

    exec sp_changemergearticle

    @publication = @replication_publication,

    @article = @tableName,

    @property = N'identity_range',

    @value = @value_identity_range,

    @force_invalidate_snapshot = 1,

    @force_reinit_subscription = 1

    exec sp_changemergearticle

    @publication = @replication_publication,

    @article = @tableName,

    @property = N'threshold',

    @value = @value_threshold,

    @force_invalidate_snapshot = 1,

    @force_reinit_subscription = 1

    exec sp_changemergearticle

    @publication = @replication_publication,

    @article = @tableName,

    @property = N'identityrangemanagementoption',

    @value = @value_option,

    @force_invalidate_snapshot = 1,

    @force_reinit_subscription = 1

    end -- while loop

    DROP TABLE #tempSysMergeArticles