August 26, 2003 at 8:42 am
I open a cursor and loop through the records. I wanted to update one record that I am fetching. I checked the BOL and read about the "WHERE CURRENT OF" clause but had not had much success with it.
Did anyone use this before? I appreciate your sharing with me some examples.
August 26, 2003 at 9:07 am
Declare your cursor as follows
USE PUBS
DECLARE @lName varchar(40)
DECLARE crsMyCursor CURSOR FOR
SELECT au_lname FROM AUTHORS
OPEN crsMyCursor
FETCH NEXT FROM crsMyCursor INTO @lName
UPDATE Authors SET au_lname = 'Hello World' WHERE CURRENT OF crsMyCursor
CLOSE crsMyCursor
DEALLOCATE crsMyCursor
August 26, 2003 at 9:44 am
THANK YOU!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy