use test
declare persons cursor for select update_time from person;
declare @insertdate datetime;
begin
open persons;
fetch next from persons into @insertdate;
while (@@fetch_status = 0)
begin
print @insertdate
fetch next from persons into @insertdate;
end;
close persons;
end;
deallocate persons
一个sql server的存储过程例子
最新推荐文章于 2021-03-13 23:54:52 发布
本文提供了一个使用T-SQL声明和操作游标的示例。通过这个例子,读者可以了解到如何声明一个游标来检索表中的数据,并逐行读取这些数据进行处理。
964

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



