declare @a char(8),@b varchar(10),@c numeric(5,2)
declare @d int
set @d=0
declare xxx cursor
for select 学号,课程名,成绩
from score
open xxx
fetch next xxx into @a,@b,@c
while @@fetch_status=0
begin
set @d=@d+1
fetch next from xxx into @a,@b,@c
end
close xxx
deallocate xxx
print @d
从score表中统计并显示出记录总数