Hi,
I am a bit stumped with this and cannot find the correct resources. What I want to do is loop through a result set in my stored procedure and change a specific field of each record. With I only want to do this if the record that is currently being check meets certain criteria. Below I will try to put it out more simple.
MyResultset has 10 records in.
WHILE MyResultSet HAS ROWS
BEGIN
IF RMyResultset.Active = 'True'
SET RMyResultset.Active = 'False'
END IF
MyResultSet.MoveToNextRow
END
How can this be achieved to build this in my SQL Stored Procedure?
I hope this explains my scenario well enough.
Thanks,
Loading
pratik jainPosted Jul 23, 2010, 8:55 AM
like this column..u can do it in select query also..
select case when RMyResultset.Active = 'True' then 'False'
else RMyResultset.Active end as 'col1' from 'table'