declare T_cursor cursor for select PhoneNo from PhoneDetail order by phoneno
open T_cursor
fetch next from T_cursor into @PhoneNo
while @@fetch_status=0
end
close T_cursor
deallocate T_cursor
open T_cursor
fetch next from T_cursor into @PhoneNo
while @@fetch_status=0
begin
end
close T_cursor
deallocate T_cursor
本文展示了一个使用T-SQL声明并操作游标的示例。通过这个例子,读者可以了解到如何声明一个游标来检索电话号码,并按电话号码顺序进行遍历。
380

被折叠的 条评论
为什么被折叠?



