October 31, 2021 at 7:50 am
Create 2 new database. And add one table in both database with below columns.
Id,
First name
Last name
Address
Phone no
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
October 31, 2021 at 12:30 pm
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
October 31, 2021 at 12:36 pm
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
November 1, 2021 at 11:43 am
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
November 1, 2021 at 2:13 pm
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
Change is inevitable... Change for the better is not.
November 1, 2021 at 6:49 pm
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
November 2, 2021 at 3:16 pm
Any interest in your own problem that you posted?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply