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

  • Home
  • SEARCH
  • 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 5940219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:56:17+00:00 2026-05-22T15:56:17+00:00

I have a requirement where i have create replication between two tables with different

  • 0

I have a requirement where i have create replication between two tables with different names and which have different column names. Is it possible to create such replication.

server A                                            server B
----------                                          ----------
Table : Test                                        Table : SUBS
--------------                                      ---------------
columns A,B,C                                       Columns D,E,F,G,H

I want to configure replication so that column A data is replicated to column D, column B data is replicated to column E, column C data is replicated to column F

  • 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-05-22T15:56:18+00:00Added an answer on May 22, 2026 at 3:56 pm

    Apparently, the answer is: “When you define the article, you’ll have to set the @vertical_partition parameter to true and then add the columns that you want with sp_articlecolumn.”

    However, I have to ask why you’re doing this. Replication in my mind isn’t a general tool for moving data around between unlike databases but for keeping two identical databases in sync.

    Other brainstorm ideas:

    • You could create a new source table that does match the destination table, and use a trigger to keep the source table synchronized.
    • Push the source table intact to the destination and do the MERGE in the destination database.
    • Replication may not really be the right solution, here. What are the business rules & requirements that are calling for this to be done? Have you considered using SSIS?
    • If there IS a need for the two tables to be in exact synchronization all the time, then what is the channel of changes to the source table–an application? It almost sounds like your application needs a new level of abstraction, a data write layer that knows how to write to two sources at the same time.

    Trying to keep data synchronized between two different databases can be a problem. There can be all sorts of subtle problems with race conditions, lack of distributed transactions (affecting consistency and response to failures), problems with the workarounds created to deal with not having distributed transactions, and so on and so forth. Can you instead create a linked server and some views that actually make the data in one database real-time accessed from the other?

    Please tell us more about your requirements and why you need to do this.

    Update

    If you’re going the manual update route note that you can’t apply a time period’s insert, update, and delete operations en masse. You have to apply them one at a time, in order. If you are instead working with current state rather than intermediate data operations, then you can do all rows at once. I will show you the MERGE example, not the history-playback one.

    BEGIN TRAN;
    
    DELETE D
    FROM LinkedServer.dbo.Dest D WITH (TABLOCKX, HOLDLOCK)
    WHERE
       NOT EXISTS (
          SELECT *
          FROM Source S
          WHERE D.Key = S.Key
       );
    
    UPDATE D
    SET
       D.Col1 = S.Col4,
       D.Col2 = S.Col5,
       D.Col3 = S.Col6,
       D.Col4 = S.Col7,
    FROM
       LinkedServer.dbo.Dest D
       INNER JOIN Source S ON D.Key = S.Key
    WHERE
       D.Col1 <> S.Col4
       OR EXISTS (
          SELECT D.Col2, D.Col4
          EXCEPT
          SELECT S.Col3, S.Col6
       ); -- or some other way to handle comparison of nullable columns
    
    INSERT LinkedServer.dbo.Dest (Col1, Col2, Col3)
    SELECT Col4, Col5, Col6
    FROM Source S WITH (TABLOCK, HOLDLOCK)
    WHERE
       NOT EXISTS (
          SELECT *
          FROM LinkedServer.dbo.Dest D
          WHERE S.Key = D.Key
       );
    
    COMMIT TRAN;
    

    You may find it better to push the whole table and do the merge operation on the destination server.

    The lock hints I put in on the first query are important if you’re going to have a consistent point-in-time snapshot. If you don’t care about that, then take the locking hints out.

    If you find that updates across the linked server are slow, then push the entire table in one piece to a temporary staging table on the remote server, and do the MERGE in a script entirely on the remote server.

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

Sidebar

Related Questions

I have a requirement to create a component which can be used stand-alone or
I have a requirement to create a simple database in Access to collect some
Normally I create web application projects and use code-behind, but I have a requirement
I have a organization name table with the following structure given below: CREATE TABLE
I have a requirement to create an application that will open up about 10
I have a requirement to create a sysDesk log file. In this requirement I
I have a requirement where a screen allows and end user to create a
I have a requirement in my app which requires me to display some message
Using SQL Server 2008, I have a requirement that email addresses in my user
I have a requirement where I need to create a dojox.layout.ContentPane programmatically. function constructContentPane(methodToBeCalled){

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.