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?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • 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 RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

  • 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)
    Intro to Tally Tables and Functions

  • 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
    Problems are opportunities brilliantly disguised as insurmountable obstacles.

    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)
    Intro to Tally Tables and Functions

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

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