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 |
|
Vack
Aged Yak Warrior
530 Posts |
Posted - 2008-05-30 : 09:17:54
|
| Using triggerwant to update a field being inserted from another record in the same table. the record being inserted I want to pull the bkjrcode from another record where the account = 1040 that also has the same ord# and inv# as the record being inserted. Here is what I've tried with no luck.create trigger [updategbkmut] on [dbo].[gbkmut]after insertasupdate g1set g1.bkjrcode = g2.bkjrcodefrom gbkmut g1inner join inserted ion i.ord_no = g1.ord_no and i.inv_no = g1.inv_noinner join gbkmut g2on i.ord_no = g2.ord_no and i.inv_no = g2.inv_nowhere i.freefield3 = 'Rebate' and g1.account = '1040' |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-30 : 10:26:59
|
| Cant find any problem with the trigger code.Whats the error you're getting? |
 |
|
|
Vack
Aged Yak Warrior
530 Posts |
Posted - 2008-05-30 : 10:34:34
|
| No error. Its just not updating the fields. |
 |
|
|
|
|
|