Getting Started with Web applications development with servlets and JSP - Part 5: Filters
First Time? You can support us by signing up. It takes only 5 seconds. Click here to sign up. If you already have an account, click here to login.


Upload Image Close it
Select File

Learned something today? Share it, or learn from what others have learned today

Adding the transactional publication in Replication - SQL Server

Oct 13 2011 9:18PM by Paresh Prajapati   

I have shared a script to enable replication database http://beyondrelational.com/justlearned/posts/724/enabling-the-replication-database-in-sql-server.aspx, here you can find a script to create publication after enabling the replication database. You can change the parameter values accordingly as this is for default values.

<pre class="brush: plain">
USE [PublisherDB]
GO

-- Adding publication

exec sp_addpublication 
    @publication = N'PublicationName',
    @description = N'Transactional publication of database ''PublisherDB'' from Publisher ''PublisherServer''.', 
    @sync_method = N'concurrent', 
    @retention = 0, 
    @allow_push = N'true', 
    @allow_pull = N'true', 
    @allow_anonymous = N'true', 
    @enabled_for_internet = N'false', 
    @snapshot_in_defaultfolder = N'false', 
    @alt_snapshot_folder = N'Replication shared Folder', 
    @compress_snapshot = N'false', 
    @ftp_port = 21, 
    @ftp_login = N'anonymous', 
    @allow_subscription_copy = N'false', 
    @add_to_active_directory = N'false', 
    @repl_freq = N'continuous', 
    @status = N'active', 
    @independent_agent = N'true', 
    @immediate_sync = N'true', 
    @allow_sync_tran = N'false', 
    @autogen_sync_procs = N'false', 
    @allow_queued_tran = N'false', 
    @allow_dts = N'false', 
    @replicate_ddl = 1, 
    @allow_initialize_from_backup = N'false', 
    @enabled_for_p2p = N'false', 
    @enabled_for_het_sub = N'false'
GO

-- Adding publication snapshot

exec sp_addpublication_snapshot 
    @publication = N'PublicationName', 
    @frequency_type = 1, 
    @frequency_interval = 0, 
    @frequency_relative_interval = 0, 
    @frequency_recurrence_factor = 0, 
    @frequency_subday = 0, 
    @frequency_subday_interval = 0, 
    @active_start_time_of_day = 0, 
    @active_end_time_of_day = 235959, 
    @active_start_date = 0, 
    @active_end_date = 0, 
    @job_login = N'Domain\WindowsUser', 
    @job_password = null, 
    @publisher_security_mode = 1
GO

-- Granting permission to users

 exec sp_grant_publication_access 
        @publication = N'PublicationName', @login = N'sa'
    GO

    exec sp_grant_publication_access 
        @publication = N'PublicationName', 
        @login = N'NT AUTHORITY\SYSTEM'
    GO

    exec sp_grant_publication_access 
        @publication = N'PublicationName', 
        @login = N'BUILTIN\Administrators'
    GO
    </pre>
Read More..  [2 clicks]


Paresh Prajapati
7 · 24% · 5511
4
 
2
 
 
0
Incorrect
 
0
Interesting
 
0
Forgotten
 
0
Move



Submit

Your Comment


Sign Up or Login to post a comment.

"Adding the transactional publication in Replication - SQL Server" rated 5 out of 5 by 4 readers
Adding the transactional publication in Replication - SQL Server , 5.0 out of 5 based on 4 ratings
    Copyright © Beyondrelational.com Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising