SQL Server Table Trigger over two Database Server with the same Table Stucture

Copper Contributor

Hello I have a question
Is it posible to create a Trigger after Update to write the hole updated data to an identical sql server with the same table structur?

To describe this in more detail: Two database servers with identical tables. One Process writes data into Table 'A' and now I want that a trigger (after insert or after update) writes the same Data into table 'A' on the second database server, with the identical table with the same Structure and the same Login. Is this possible?


Greetings from Germany


Greetings from germany

1 Reply


Yes. Please follow below step:

  1. Create Linked server and set "RPC" and "RPC Out" to "True" from "Security Option".
  2. Linked server user have insert access on table.
  3. Write four part naming while inserting data in trigger
INSERT INTO [LINKED-SERVER-IP].MyDb.dbo.Customer (CustomerId, CustomerName)
SELECT CustomerId, CustomerName FROM MyCustomers WHERE CustomerId = 5

    4. Enable Distributed transactions on server.