■—通过判断@ FETCH STATUS进行循环 WHILE @@FETCH STATUS=O ■ BEGIN PRINT’课程号:’+@ CouN+课程名称 +@CouName 取得下一条记录 FETCH NEXT FROM Crs Course INto @CouNo @ CouName ■END ■ ClOSE CrsCourse a DEALLOCATE CrSCourse--通过判断@@FETCH_STATUS进行循环 WHILE @@FETCH_STATUS=0 BEGIN PRINT '课程号:' + @CouNo+'课程名称:‘ + @CouName --取得下一条记录 FETCH NEXT FROM CrsCourse INTO @CouNo,@CouName END CLOSE CrsCourse DEALLOCATE CrsCourse