I have a problem with the following proc.
The code inside the proc runs fine when you highlight it and run. But if you try to run the stored procs, the last 2 UPDATE statements are not executed.

Is there a missing GO between the blocks?

CREATE PROCEDURE APPEND_ALLEGRO_POSITION
AS

BEGIN
SELECT ah.investment_id,
ah.quantity_q,
ah.price,
ah.price_dt,
ah1.investment_id as und_investment_id,
ah1.quantity_q as und_quantity_q,
ah1.price as und_price,
ah1.price_dt as und_price_dt
INTO #temp_posn
FROM AVATAR_HOLDINGS ah,AVATAR_ID_MATCH aim, AVATAR_HOLDINGS ah1
WHERE ah.investment_id=aim.cic
AND aim.UnderlyingId=ah1.investment_id

DELETE FROM ALLEGRO_POSITION

INSERT INTO ALLEGRO_POSITION ( id_inst, investment_id, am_pos, price, price_dt, am_pos_und )
SELECT null,
ah.investment_id,
ah.quantity_q,
ah.price,
ah.price_dt,
tp.und_quantity_q
FROM #temp_posn tp,AVATAR_HOLDINGS ah
WHERE ah.investment_id*=tp.investment_id

UPDATE ALLEGRO_POSITION
SET id_inst=aix.id_inst
FROM ALLEGRO_INSTRUMENT_XREF aix,AVATAR_HOLDINGS ah
where ah.Cusip*=aix.id_cusip
AND ALLEGRO_POSITION.investment_id=ah.investment_id

UPDATE ALLEGRO_POSITION
SET price=apt.price,
price_dt=apt.price_dt
FROM AVATAR_PRICES_TRADER apt,ALLEGRO_BUSINESS_DAY abd
where ALLEGRO_POSITION.investment_id=apt.investment_id
AND abd.lst_bus_date=apt.price_dt
END
GO