|
Posted by steven on 10/19/06 17:02
Does anyone know how to do the following. I'm trying to mimic
replication with triggers.
I have 2 databases, each have these 2 tables.
1.
USERS
ID int
NAME varchar(20)
2.
CHANGES
TABLE varchar(20)
TYPE varchar(10)
col1 varchar(20)
col2 varchar(20)
On the USERS table I have a for insert trigger. Whenever a new user is
added the trigger puts an entry into the CHANGES table such as
("USERS", "INSERT", "1", "Fred")
I now have an application (vb.net) that monitors the CHANGES table on
server1. If it finds an entry it determines the table using the TABLE
column and performs the necessary insert and deletes the entry from
CHANGES. Now the problem is server2 also has an for insert trigger on
the USERS table so it puts an entry into CHANGES on server2. As you
can imagine this goes around in a loop.
What I was hoping for was someway of saying, "I'm inserting from my
application so don't do the trigger".
Any ideas gratefully appreciated.
Steve.
Navigation:
[Reply to this message]
|