I've got a guy here at work trying to help on this too, but he's known for being constantly interrupted, so I'm not sure he'll be able to come through for me.
I have two tables. TableA and TableB. Table B is a lookup table.
There is a foreign key relationship between TableA.Blah and TableB.Blah.
So here's what I need the trigger to do.
Whenever a value is inserted or updated in TableA.Blah, check for that value in TableB.Blah.
If it DOES exist in TableB.Blah, fine and dandy. Let TableA.Blah finish being updated/inserted.
If it does NOT exist in TableB.Blah, insert it into TableB.Blah and then let TableA.Blah finish inserting/updating.
It's probably simple as all hell, but I've not written any kind of trigger before. So, heeeeeeeeeeeeeeeeeeeeelp...
I have two tables. TableA and TableB. Table B is a lookup table.
There is a foreign key relationship between TableA.Blah and TableB.Blah.
So here's what I need the trigger to do.
Whenever a value is inserted or updated in TableA.Blah, check for that value in TableB.Blah.
If it DOES exist in TableB.Blah, fine and dandy. Let TableA.Blah finish being updated/inserted.
If it does NOT exist in TableB.Blah, insert it into TableB.Blah and then let TableA.Blah finish inserting/updating.
It's probably simple as all hell, but I've not written any kind of trigger before. So, heeeeeeeeeeeeeeeeeeeeelp...