September 25, 2006 at 5:58 pm
CREATE
TRIGGER 1_trig ON option
AFTER
INSERT , UPDATE
As
update option
set pr.ID = o.ProvinceID
from option o , Provinces pr
where pr.postal = o.state
is this script have any syantax errors
this gave error
Msg 4104, Level 16, State 1, Line 2
The multi-part identifier "pr.ID" could not be bound.
pls help
September 28, 2006 at 8:00 am
This was removed by the editor as SPAM
September 28, 2006 at 9:01 am
Well, for starters, your UPDATE statement states that you are updating table option, but the SET clause is assigning a value in the providence table. Which table and value are you attempting to update? If your intention was to update the providence table, try this:
CREATE TRIGGER trig ON [option] AFTER INSERT , UPDATE
AS
BEGIN
UPDATE pr
SET pr.ID = o.ProvinceID
FROM [option] o
INNER JOIN Provinces pr
ON pr.postal = o.state
END
September 28, 2006 at 10:32 am
Are you trying to update option table or Provinces table. Cos ur statement is trying to update a column in "Provision" table while ur update statement says "Update Option" table.
October 4, 2006 at 6:17 pm
thnks for suggestion
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply