游标的使用
来源:互联网 发布:图书馆数据库设计 编辑:程序博客网 时间:2024/06/08 01:24
遍历某个表时要用到游标
declare HistoryCur cursor for
select _order,dataitemid from #idlist;
declare @tablename varchar(50);
declare @itemid int;
open HistoryCur;
fetch next from HistoryCur into @tablename,@itemid;
while(@@fetch_status <> -1) --等于 -1表示没有遍历完成
begin
--对@tablename,@itemid进行操作
fetch next from HistoryCur into @tablename,@itemid;
end
- 关于游标的使用
- 游标的使用
- 游标的使用
- 游标的使用
- 游标的使用
- 游标的使用
- 游标的使用
- 游标的使用问题
- 游标的使用
- sqlserver游标的使用
- sql游标的使用
- 使用游标的触发器
- sql2000-游标的使用
- SQL游标的使用
- [MSSQL]游标的使用
- 游标的使用
- mysql 游标的使用
- mysql 游标的使用
- nginx load balance
- arcEngine部分刷新问题
- Request.ServerVariables (server environment variable)
- 【PHP系列教程】(3)——PHP的类型
- SWT异常: Invalid thread access
- 游标的使用
- iptables源码分析(1)
- linux下安装java jdk及环境变量配置
- WinCE BSP中的Dirs文件和Sources文件(转自微软MVP作者:ARM—WinCE) 收藏
- ODI笔记一 – 创建存储库
- sql 格式化 日期函数
- 《调试高手和编程高手》
- VS2005 ATL项目错误
- 做需求调研必须回答的三个问题