What I thought was a simple update....
I would like to update multiple rows of table2 upon insert or update of table1. My approach was to create a trigger on table1 .....
CREATE TRIGGER [trgOECusItemMaster] ON [table1]
FOR INSERT,UPDATE
AS
declare @item_no varchar(50)
declare @cus_item_no varchar(500)
select @item_no = item_no, @cus_item_no = cus_item_no from inserted
exec spUpdtSFOCustItemNbr @item_no, @cus_item_no
Then have the trigger call an sp to update the rows in table2.....
CREATE PROCEDURE [spUpdtSFOCustItemNbr]
(@item_no varchar(50), @cus_item_no varchar(500))
AS
update table2
set user_def_fld_2 = @cus_item_no
from table2
where item_no = @item_no
The error is: Subquery returned more than 1 value.
How do I get past this error?
I would like to update multiple rows of table2 upon insert or update of table1. My approach was to create a trigger on table1 .....
CREATE TRIGGER [trgOECusItemMaster] ON [table1]
FOR INSERT,UPDATE
AS
declare @item_no varchar(50)
declare @cus_item_no varchar(500)
select @item_no = item_no, @cus_item_no = cus_item_no from inserted
exec spUpdtSFOCustItemNbr @item_no, @cus_item_no
Then have the trigger call an sp to update the rows in table2.....
CREATE PROCEDURE [spUpdtSFOCustItemNbr]
(@item_no varchar(50), @cus_item_no varchar(500))
AS
update table2
set user_def_fld_2 = @cus_item_no
from table2
where item_no = @item_no
The error is: Subquery returned more than 1 value.
How do I get past this error?