Forum Discussion
MichaelBurkhardt
Feb 08, 2019Copper Contributor
SQL Server Table Trigger over two Database Server with the same Table Stucture
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 d...
Nirav_Gandhi
May 28, 2019Copper Contributor
Yes. Please follow below step:
- Create Linked server and set "RPC" and "RPC Out" to "True" from "Security Option".
- Linked server user have insert access on table.
- 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.
https://dba.stackexchange.com/questions/218936/insert-trigger-to-a-linked-server-error