I presume the procedure "returns" the value
DECLARE @val INT
EXEC @val = StoredProcedure1
UPDATE Table1
SET Column1 = @newvalue
if the procedure does a "SELECT", you should consider to change that, possibly into returning the data into an output parameter, the usage will change to:
DECLARE @val INT
EXEC StoredProcedure1 @val OUTPUT
UPDATE Table1
SET Column1 = @newvalue
Main Topics
Browse All Topics





by: aneeshattingalPosted on 2009-11-03 at 12:16:37ID: 25733073
u cannot do an update like that, either you have to convert that sp into a user efined function and perform the update or else use a cursoror similar mechanism to loop thru each row and update those rows with the value that the sp retruns , anyway we need to see the sp to make further suggessions