How to do? DB1 + DB2 = DB

  • Hello SQL LoVers!!

    I have the following situation / PROBLEM:

    I have a database (suppose named DB) that is created and filled by a RsView32 project.

    By ODBC the database is connected to PC1 and to PC2. At this point both PC's have equal databases. PC1 as database named DB and PC2 have database named DB.

    But in both PC's some new (local) data is added to databases and now they are not longer equal.

    PC1 and PC2 replicates their databases to PC3. Now at PC3 I have DB1 (database from PC1) and DB2 (database from PC2).

    PC3 replicates (2 subscriptions) both databases to PC4. Now PC4 has DB1 and DB2.

    Now I need to create only one database.

    DB1 - table x

    Tag

    Value

    Caud

    23

    Press

    78

    Caud

    89

    Press

    87

    DB2 - table x

    Tag

    Value

    Caud

    23

    Press

    78

    Caud

    89

    UserID

    999

    I want only one database DB with only one table x with:

    Tag

    Value

    Caud

    23

    Press

    78

    Caud

    89

    Press

    87

    UserID

    999

    How can I do this????

    Should I do this at PC3 or at PC4?

    Please help me!

    Thanks, Cláudia


    Regards,

    Cláudia Rego

    www.footballbesttips.com

  • This workaround may help you.

    After the snapshot replications ( both tables )are created (let me say them are created as DB1_TableX and DB2_TableX) , stop the agent for a while.

    Copy the initial data into one table. (better to go for a third table)  (You need to findout the logic in getting the correct data)

    Change the replication procedures to point to the new table. Again you may have to include the logic in identifying conflicts in updates and resolving them.

    you have a problem in this approach:  Each time you do modification to replication, or repopulate snap shot replication, you may have to redo the same work.

    I hope this piece of information will help you. 

     

     

    Cheers,
    Prithiviraj Kulasingham

    http://preethiviraj.blogspot.com/

  • Should I use Merge replication at some point???

    Thanks


    Regards,

    Cláudia Rego

    www.footballbesttips.com

  • I dont see a need for that.

    Cheers,
    Prithiviraj Kulasingham

    http://preethiviraj.blogspot.com/

  • The real question is if data can be changed at PC1 and PC2 independently?

    If the anwser is yes then you do need merge

     


    * Noel

  • I agree on principle.  If you are including the logic into the replication sprocs, besically you are manually merging it. However, you dont have to make the replication as "merge replication"

     

    Cheers,
    Prithiviraj Kulasingham

    http://preethiviraj.blogspot.com/

  • Noel said:

    "The real question is if data can be changed at PC1 and PC2 independently?

    If the anwser is yes then you do need merge "

    My RsView32 project controls a physical process and stores the relevant data in a database. By pooling, this data is constantly actualized.

    PC1 and PC2 are feeded by ODBC. So both have databases and tables with same name and same data. At this point these databases are equal!

    But in both PC's some new (local) data is added to databases, for example a user logins only at PC2. Now databases at PC1 and PC2 are not longer equal.

    So I think the answer to noel's question is YES!

    In my solution I have two databases but that isn't what i want. I need just one database with all data together!

    Thanks!

    Good work, Cláudia


    Regards,

    Cláudia Rego

    www.footballbesttips.com

Viewing 7 posts - 1 through 6 (of 6 total)

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