Hi all, I have a question about instead of trigger.
I have a situation in which I have 2 tables A and B, and a view V which is derived from both these tables.
Now I need to have a table T which, gets its values from the view V. However, since we can write only instead of triggers on views, and I need view V for other purposes, I created a temporary view V1, from view V. I then wrote an instead of trigger on this temp view which inserts into the table T instead of the temp view V1.
the problem here is, if i manually enter data into the temp view V1, the trigger works correctly, but if I update the tables A&B, which in turn updates view V, which in turn changes temp view V1, the trigger does not work. It inserts in the temp view and not in the table T.
How do I fix this? Or is there any easier way to implement what im doin? After reading what i just wrote, it does seem a little complicated. Is this got something to do with bulk inserts?
Someone please help me out on this. I'm using SQL Server 2000 btw.
I have a situation in which I have 2 tables A and B, and a view V which is derived from both these tables.
Now I need to have a table T which, gets its values from the view V. However, since we can write only instead of triggers on views, and I need view V for other purposes, I created a temporary view V1, from view V. I then wrote an instead of trigger on this temp view which inserts into the table T instead of the temp view V1.
the problem here is, if i manually enter data into the temp view V1, the trigger works correctly, but if I update the tables A&B, which in turn updates view V, which in turn changes temp view V1, the trigger does not work. It inserts in the temp view and not in the table T.
How do I fix this? Or is there any easier way to implement what im doin? After reading what i just wrote, it does seem a little complicated. Is this got something to do with bulk inserts?
Someone please help me out on this. I'm using SQL Server 2000 btw.