Using Triggers in conjunction with linked servers

  • No...this is not a riddle or a trick 😛

    I have two linked servers, server1 and server 2, linked to each other

    I have server1.db1.table1 and server2.db2.table2, both with triggers that insert/update each other, based on status columns

    server1.db1.table1 has an individual insert and an individual update trigger:

    [1A]insert trigger inserts a record in server2.db2.table 2, status 1, which subsequently triggers [2A]

    [1B]update trigger fires when status is '1307' (see [2B]) and updates status to '1304', and then selects the data from the tables in server2.db2 updated in [2A] and updates other tables in server1.db2 (same server, different db)

    server2.db2.table2 has an insert and an update as well as another update trigger:

    [2A]insert and update fires an .exe program designed perform an external process, and then to update other tables in server2.db2. Status is a number between 1-14, but will only fire off when status is 1-13.

    [2B] once status reaches 14 (within 40 sec or less), update trigger updates server1.db1.table1 to status '1307', thereby firing off trigger [1B]

    The basic order is 1A, 2A, 2B, 1B

    Everything works fine as long as I simply update the status in both tables. I get a .Net "Transfer Context" error when I try to implement both the .exe in [2A] and the updating of tables in [1B]

    Any ideas anyone? I can get more explicit if need be...

    Any comments would be greatly appreciated!!!

    Thanks in advance

    Robert

  • Oh...one last thing...SQL Server 2005

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply