例3、利用游标遍历,显示整个结果集 USE XK 定义游标 I DECLARE @CouNo varchar(3), @CouName varchar(20 DECLARE CrsCourse cursor ■FOR seleCt CouNo, CouName from Course OrdEr by COuN 打开游标 ■ open Crs course ■一-取得第一条记录 FETCH NEXt FROM Crs Course into COuNo @CouName例3、利用游标遍历,显示整个结果集 USE Xk --定义游标 DECLARE @CouNo varchar(3),@CouName varchar(20) DECLARE CrsCourse CURSOR FOR SELECT CouNo,CouName FROM Course ORDER BY CouNo --打开游标 OPEN CrsCourse --取得第一条记录 FETCH NEXT FROM CrsCourse INTO @COuNo,@CouName