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

Script to add table in existing publication in transactional replication - SQL Server

Oct 2 2011 4:32AM by Paresh Prajapati   

I would like to share a script to add tables in existing publication in transactional replication,

USE PublisherDB
GO
exec sp_addarticle 
@publication = N'PublicationName', 
@article = N'TableName', 
@source_owner = N'SchemaName', 
@source_object = N'TableName', 
@type = N'logbased', 
@description = N'', 
@creation_script = N'', 
@pre_creation_cmd = N'drop', 
@schema_option = 0x00000000080350DF, 
@identityrangemanagementoption = N'manual', 
@destination_table = N'TableName', 
@destination_owner = N'SchemaName', 
@status = 24, 
@vertical_partition = N'false', 
@ins_cmd = N'CALL [sp_MSins_SchemaNameTableName]', 
@del_cmd = N'CALL [sp_MSdel_SchemaNameTableName]', 
@upd_cmd = N'SCALL [sp_MSupd_SchemaNameTableName]',
@force_invalidate_snapshot = 1
GO

You can read the earlier post to get details of publications, subscribers and articles at http://beyondrelational.com/justlearned/posts/688/find-the-details-of-publications-subscribers-and-articles-at-once-in-replication-sql-server.aspx

Read More..  [0 clicks]


Paresh Prajapati
7 · 24% · 5511
8
 
0
Knew
 
 
0
Incorrect
 
0
Interesting
 
0
Forgotten
 
0
Move



Submit

Your Comment


Sign Up or Login to post a comment.

"Script to add table in existing publication in transactional replication - SQL Server" rated 5 out of 5 by 8 readers
Script to add table in existing publication in transactional replication - SQL Server , 5.0 out of 5 based on 8 ratings
    Copyright © Beyondrelational.com Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising