Have a problem with using cursors in SQL server enterprise manager.
My code sql query is followed
---------------------------------------
DECLARE @element_name varchar(100)
DECLARE elements_cursor CURSOR FOR
SELECT element_name
FROM KB_Element_Ref
OPEN elements_cursor
FETCH NEXT FROM elements_cursor INTO @element_name
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT @element_name
FETCH NEXT FROM elements_cursor INTO @element_name
END
CLOSE elements_cursor
DEALLOCATE elements_cursor
------------------------------------------------------------
I have more than 100 rows int KB_Element_Ref table.
but when I execute this query, it said only a row has affected and did't
print any element_name.
does any one know what is going on?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!