I'd like to create a trigger against an insert of a table in my database. So for example, if I have a company_name
table, I'd like to do the following:
- Insert new row into
company_name
table on server A - Invoke a trigger that gets the newly inserted id of the row in
company_name
on server A. Set identity_insert ON
on thecompany_name
table in server B- Insert that same exact row that was just inserted into server A into the
company_name
table on server B.
The linked server can be referred to as [ServerB].[ServerB-Database].dbo.company_name
.
This is a requirement due to data hosting restrictions of clients in different countries.