0
在SQL Server 2008中使用遊標時,在哪個語句中將表中的值加載到遊標中?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