在SQL Server 2008中使用游标时,在哪个语句中将表中的值加载到游标中?
declare @sname nvarchar(50)
declare cur1 cursor
for
select sname from tstudent
open cur1
FETCH NEXT FROM cur1 INTO @sname
print @sname
WHILE @@FETCH_STATUS = 0
BEGIN
FETCH NEXT FROM cur1 INTO @sname
if @@FETCH_STATUS = 0
print @sname
END
CLOSE cur1
DEALLOCATE cur