How to solve this

  • Create 2 new database. And add one table in both database with below columns.

    Id,

    First name

    Last name

    Address

    Phone no

    Email

    Date of birth

    IsActive

    - create trigger and transfer data one database to another database through xml if records is insert and update in both operation.

    Note : Please do not insert data directly into another table. Transfer xml from one database to another database and read data from xml and insert into table in another database

  • It's a school assignment?  There are seemingly quite a few steps to accomplish.  What's the question?

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • To improve efficiency, I'd suggest you add columns to your data to track DateCreated and DataModified.

    What is the reason for using XML in the data transfer?

    Why do you want to use a trigger to do this? Why not a scheduled job running every x minutes?

    Presumably, Id is the unique identifier for the tables? What is its datatype? How are you ensuring that a new Id in table 1 will never have the same value as a new Id in table 2?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • That's a convoluted way to go about a data transfer. Why do you have to use XML? Why do you have to use triggers? SQL Server has built in mechanisms for getting data between two databases, Availability Groups, Log Shipping, Replication. One of those is going to do a better job.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • I've got to ask, as well.  Why the requirement of doing the transfer with (ugh!) XML?  That is, quite possibly, the absolute slowest and "pipe heavy" method that you could possibly use.  IMHO, the ONLY valid purpose in doing it with XML is to test your abilities to use XML in some form of class.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden wrote:

    I've got to ask, as well.  Why the requirement of doing the transfer with (ugh!) XML?  That is, quite possibly, the absolute slowest and "pipe heavy" method that you could possibly use.  IMHO, the ONLY valid purpose in doing it with XML is to test your abilities to use XML in some form of class.

    My first thought was an assignment to build a service broker to simulate sending/receiving messages from an external source.  But that is a guess and would require much more information from the OP.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • @sunilkmr284 ,

    Any interest in your own problem that you posted?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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