SQL Server Trigger using inserted ID -
i'd create trigger against insert of table in database. example, if have company_name
table, i'd following:
- insert new row
company_name
table on server a - invoke trigger gets newly inserted id of row in
company_name
on server a. set identity_insert on
oncompany_name
table in server b- insert same exact row inserted server
company_name
table on server b.
the linked server can referred [serverb].[serverb-database].dbo.company_name
.
this requirement due data hosting restrictions of clients in different countries.
one problem lag , connection between countries , b.
while remote insert happens, local transaction still running. reduces performance , increases blocking.
the remote server unavailable too. or take long respond. can code trigger not fail have inconsistent data.
finally, if there inserts on remote server have multi-master problem.
i consider solution replication publish data server. or consider using service broker decouple local , remote inserts.
Comments
Post a Comment