Replication

  • Hi Everyone,

    Can some one help me. I have a question in Replication.

    How do add articles to the existing replication without re-initializing. Please explain step by step as i'm new to SqlServer.

    Regards,

    Swetha.

  • Here are the steps to add article in publication without setting up whole replication again or running the whole snapshot again.

    First Execute these two statements :-

    To Get the publication Name:-

    exec dbo.sp_helppublication

    EXEC sp_changepublication

    @publication = 'PublicationName',

    @property = N'allow_anonymous',

    @value = 'false'

    GO

    EXEC sp_changepublication

    @publication = 'PublicationName',

    @property = N'immediate_sync',

    @value = 'false'

    GO

    Add table to publication :

    exec dbo.sp_addarticle 'PublicationName' ,@article='TableNeedsToBeAdded',@@source_Object=' TableNeedsToBeAdded',@destination_table='TableNeedsToBeAdded',

    @force_invalidate_snapshot=1

    Go

    Refresh the subscription : -

    exec dbo.sp_refreshsubscriptions 'PublicationName'

    go

    Now run the snapshot agent which will only update the object changed/ added new object

    exec msdb.dbo.sp_start_job @job_name='JobName'

    go

    How to find out the Snapshot agent job name:-

    Select Name From MSDB.dbo.sysjobs

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply