TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Space Ghost
NA
45
0
Looping through each record and modifying
Jul 20 2010 6:43 AM
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,
Reply
Answers (
1
)
Sql 2005
SQL: Creating Dynamic database connection