I will have to assume that your procedure takes a single parameter, although you list it as it is taking four parameters.
By the way, don't call your procedures sp_something. The sp_ prefix is reserved for system procedure, and would Microsoft ship a system procedure sp_updatevalue in a future release of SQL Server, this is the procedure that would be invoked, not your.
Here is a cursor:
DECLARE @cur CURSOR,
@value int
SET @cur = CURSOR STATIC FOR
SELECT FeatureValue FROM #updatestatus WHERE FeatureValue > 0
OPEN @cur
WHILE 1 = 1
BEGIN
FETCH @cur INTO @value
IF @@fetch_status <> 0 BREAK
EXEC sp_updatevalue @value
END
You declare a cursor variable, and then you assign that cursor with the SET statement. Always use the syntax that I showed you: CURSOR STATIC FOR followed by the SELECT statement to select the data.
The OPEN command is the statement that actually populates the cursor.
You loop over the cursor until you have gotten all rows. The FETCH statement retrieves one row at a time, and the variables in the FETCH statement must match the columns in the SELECT statement that populates the cursor. @@Fetch _status is a function which returns a non-zero value when there are no more rows in the cursor.
If you google around, you will find different ways to run cursors, using a different syntax, and also a different disposition of the WHILE loop. However, I submit that the above is the optimal way to run a cursor.