Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8822809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:11:57+00:00 2026-06-14T06:11:57+00:00

I am able to configure transactional replication using SSMS and it works properly. But

  • 0

I am able to configure transactional replication using SSMS and it works properly. But i want to configure it using script so that i use it from my c#/vb application.

Is there any way to do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T06:11:58+00:00Added an answer on June 14, 2026 at 6:11 am

    If you complete all the step of transactional replication using SSMS then it’s not complicated to do with the script.

    Just carefully observe that when you configure distribution, publication and subscription SSMS gives you the option to generate script in every step.

    You can use that generated script.

    But only difference is when you add articles to publication. You can use the following code to add article

    declare @name nvarchar(50)
    declare curname cursor for
    select name from sysobjects where type = 'U'
    open curname
    fetch next from curname into @name
    while @@FETCH_STATUS = 0
    begin
    if exists(select * from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where CONSTRAINT_TYPE = 'PRIMARY KEY' AND TABLE_NAME = @name AND TABLE_SCHEMA = 'dbo')
    begin
    exec sp_addarticle
    @publication = N'publication_name', @article = @name, @source_owner = N'dbo',
    @source_object = @name, @type = N'logbased', @description = null, @creation_script = null,
    @pre_creation_cmd = N'drop', @schema_option = 0x000000000803509F,
    @identityrangemanagementoption = N'manual', @destination_table = @name,
    @destination_owner = N'dbo', @vertical_partition = N''
    end
    fetch next from curname into @name
    end
    close curname
    deallocate curname
    

    Or, you can see https://hasibarnab.wordpress.com/category/sql-server/replication/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that I want to be able to configure the connection
I have an iphone app that I want to be able to configure to
Using NHibernate, I need to be able to configure my application to sort a
I have an application written in C# that needs to be able to configure
I am able to run Grails application on tomcat using SSL but I am
I want to programmatically configure a wpf grid. I want to be able to
I want to be able to create schedules that can be executed based on
I'm not able to configure Geronimo/ActiveMQ so that more then 10 Messages get processed
I seem to recall being able to configure asp.net ajax using attributes on the
I'm building an application using WPF that will be a designer of sorts, meaning,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.