declare @name varchar(30) DECLARE authors_cursor CURSOR FOR SELECT name FROM authors OPEN authors_cursor FETCH NEXT FROM authors_cursor into @name WHILE @@FETCH_STATUS = 0 BEGIN print @name FETCH NEXT FROM authors_cursor into @name end CLOSE authors_cursor DEALLOCATE authors_cursor
DECLARE authors_cursor CURSOR
FOR SELECT name FROM authors
OPEN authors_cursor
FETCH NEXT FROM authors_cursor into @name
WHILE @@FETCH_STATUS = 0
BEGIN
print @name
FETCH NEXT FROM authors_cursor into @name
end
CLOSE authors_cursor
DEALLOCATE authors_cursor