mattster
01-25-2006, 04:06 AM
I have a DB with say 5 tables, what i wish to do is when a record is added to Table1 - which uses the auto incriment on the ID - i need to create records in the other 4 tables using that ID from Table1.
In other words when a record is added to Table1, i need new records (just one per table) automatically created in Table2, Table3, Table4 & Table5 - the only data that needs to be inserted into these new records is the ID from Table1.
Unfortunately i am not too familiar with Triggers but i am hoping it can be done using them. Also, i do not know if it can be done simply by creating the trigger on Table1 or whether i would have to create one on Table1 that points to Table2, then Table2 to Table3 etc...
I am using MS SQL 2000 and i only need the trigger(s) to fire when a new record is created in Table1 - not when updated.
Any help with this would be greatly appreciated, I would like some syntax help/example as well if possible.
Many Thanks!
In other words when a record is added to Table1, i need new records (just one per table) automatically created in Table2, Table3, Table4 & Table5 - the only data that needs to be inserted into these new records is the ID from Table1.
Unfortunately i am not too familiar with Triggers but i am hoping it can be done using them. Also, i do not know if it can be done simply by creating the trigger on Table1 or whether i would have to create one on Table1 that points to Table2, then Table2 to Table3 etc...
I am using MS SQL 2000 and i only need the trigger(s) to fire when a new record is created in Table1 - not when updated.
Any help with this would be greatly appreciated, I would like some syntax help/example as well if possible.
Many Thanks!