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:

  1. insert new row company_name table on server a
  2. invoke trigger gets newly inserted id of row in company_name on server a.
  3. set identity_insert on on company_name table in server b
  4. 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

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -