September 17, 2004 at 11:25 am
HI
after definnig a cursor whice have more then one field how do i access aspecific field on the cursor?
for example:
DECLARE Employee_Cursor CURSOR FOR
SELECT LastName, FirstName
FROM Northwind.dbo.Employees
OPEN Employee_Cursor
FETCH NEXT FROM Employee_Cursor
HOW DO I ACCES THE FIELD FirstName ?
Employee_Cursor.FirstName ??? (DOSENT WORK)
I seen example with the fetch into but it was for a single field cursor.
thanks
September 17, 2004 at 11:52 am
declare @FirstName varchar(100)
declare @LastName varchar(100)
FETCH NEXT FROM Employee_Cursor INTO @LastName, @FirstName
September 18, 2004 at 1:23 am
Is there no other way, what if i have a cursor with 20 fields ?
thanks
September 18, 2004 at 10:55 am
20 fields = 20 variables I am afraid!!!
Have you tried avoiding the use of a cursor by using temp tables instead?
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply