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-06-24 : 10:35:07
|
Using OrderRebate Table.Have two records getting inserted. All fields are identical except for cd_tp. If 2 records are inserted I would like the record with cd_tp 3 deleted. Code below doesn't seem to be workingdelete orderrebateFROM OrderRebate inner join inserted on inserted.ord_type = OrderRebate.ord_type andinserted.ord_no = OrderRebate.ord_no and inserted.line_seq_no = OrderRebate.line_seq_nowhere inserted.ord_type = OrderRebate.ord_type and inserted.ord_no = OrderRebate.ord_noand inserted.line_seq_no = OrderRebate.line_seq_no and inserted.cd_tp = '3'END |
|
|
Vack
Aged Yak Warrior
530 Posts |
Posted - 2008-06-24 : 10:56:13
|
| Figured this out. Had the wrong syntax by my create trigger statment. Had for delete instead of after insert. Once I put After Insert it worked. |
 |
|
|
|
|
|