Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
nandithab
Starting Member
6 Posts |
Posted - 2008-02-11 : 05:01:51
|
| I have a trigger to update multiple rows.But the trigger will fire only on the last row that is being updated .I need to make a trigger that fires for ALL the records that are being updated into a particular table. For example:Table BOOK:id -PK for BOOK tableauthortitleyearTable MODIFIEDBOOKid-FK to MODIFIEDBOOK tableactionOn updating the PK of Parent table ie.,BOOK,it has to update the FK of child table MODIFIEDBOOK with the corresponding updated id.The trigger which i created on BOOK table,checks for any update that is performed on the BOOK table and it updates the child table MODIFIEDBOOK with the respective new id s.But the trigger fires only for the last updated value in Parent Table Book.I want that to fire for every updated row in parent table...How can i do this?. |
|
|
ayamas
Aged Yak Warrior
552 Posts |
Posted - 2008-02-11 : 05:06:30
|
| Why you want to use a trigger?You can set the cascade property for update in relationship for the key columns. |
 |
|
|
nandithab
Starting Member
6 Posts |
Posted - 2008-02-12 : 04:36:35
|
| if i use cascade property to those tables,then it forms concurrent relations between those tables(actually there is another tables linked to this.So it forms concurrent relations between 3 tables)...and cascade property fails in this situation..only option is to use trigger to update in child table... |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
nandithab
Starting Member
6 Posts |
Posted - 2008-02-12 : 07:50:03
|
| ya |
 |
|
|
|
|
|