游标循环结果集
来源:互联网 发布:apache 长度 编辑:程序博客网 时间:2024/05/16 08:07
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER proc [dbo].[a]
as
--声明变量
Declare @AssetsId nvarchar(36)
Declare @AppSystemId nvarchar(50)
Declare @Purpose nvarchar(2000)
Declare @IPAddress nvarchar(50)
Declare @DevelopLanguage nvarchar(50)
Declare @ReleaseDate datetime
Declare @Scratchpad nvarchar(50)
Declare @Developer nvarchar(50)
Declare @DevelopTool nvarchar(50)
Declare @OSEdition nvarchar(50)
Declare @DataBase nvarchar(50)
Declare @OnDutyPerson nvarchar(max)
--声明游标
Declare Cur Cursor For
select AssetsUsingID,AffiliatedSystem,Purpose,IPAddress,DevelopLanguage,ReleaseDate,Scratchpad,Developer,DevelopTool,ControlSystemEdition,DataBaseInfo,getUser
from dbo.YWGL_AssetsUsing inner join YWGL_ServerInfo on YWGL_AssetsUsing.AssetsUsingID=YWGL_ServerInfo.AssetsID
where AssetsUsingId
in
(
select AssetsID from dbo.YWGL_ServerInfo
)
--打开游标
open Cur
--取值
Fetch next From Cur Into @AssetsId,@AppSystemId,@Purpose,@IPAddress,@DevelopLanguage,@ReleaseDate,@Scratchpad,@Developer,@DevelopTool,@OSEdition,@DataBase,@OnDutyPerson
--循环
While @@fetch_status=0
begin
insert into YWGL_AddServerByAppsys(AssetsId,AppSystemId,Purpose,IPAddress,DevelopLanguage,ReleaseDate,Scratchpad,Developer,DevelopTool,OSEdition,[DataBase],OnDutyPerson)
values(@AssetsId,@AppSystemId,@Purpose,@IPAddress,@DevelopLanguage,@ReleaseDate,@Scratchpad,@Developer,@DevelopTool,@OSEdition,@DataBase,@OnDutyPerson)
Fetch next From Cur Into @AssetsId,@AppSystemId,@Purpose,@IPAddress,@DevelopLanguage,@ReleaseDate,@Scratchpad,@Developer,@DevelopTool,@OSEdition,@DataBase,@OnDutyPerson
end
Close Cur
Deallocate Cur
- 游标循环结果集
- SQL中运用游标循环结果集
- 利用mysql游标循环结果集
- 一个存储过程 游标循环结果集
- sql循环嵌套、游标使用、循环结果集示例
- mysql中游标循环处理结果集时判断游标是否到结果最后
- SQL查询结果集游标循环获得行数据
- mysql 存储过程中利用游标循环结果集
- MySQL通过游标来实现通过查询结果集循环
- 使用游标对查询结果循环
- mysql存储过程 游标 查询结果循环
- mysql存储过程 游标 查询结果循环
- 结果集游标
- 游标结果集位置
- SQL Server 结果集循环处理的 避免游标处理方法
- JDBC中结果集游标
- java oracle游标结果集
- SQL循环结果集
- impdp ORA-39083: Object type INDEX_STATISTICS failed to create with error
- 三层结构
- JDK1.6在LINUX下的安装配置
- 文件描述符和文件指针的区别
- 重提URL Rewrite(4):不同级别URL Rewrite的一些细节与特点
- 游标循环结果集
- 委托 事件 密封类 静态类 抽象类 接口
- isapi_rewrite实现防盗链
- 用ISAPI_Rewrite实现反向代理(ReverseProxy)
- 用传输表空间跨平台迁移数据
- windows环境jetspeed2安装和配置
- IIS重启命令
- android Supporting multiple screen翻译一
- 利用 DirectShow 开发自己的 Filter