sql 2008 游标
Posted 路人甲zzz
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 2008 游标相关的知识,希望对你有一定的参考价值。
begin declare PlatformBulletin --定义游标 cursor for select UserID,ZMSCompanyID from base_UserCompany where isActive = 1 open PlatformBulletin --打开游标 declare @userid int,@zmscompanyid int fetch next from PlatformBulletin into @userid,@zmscompanyid while (@@fetch_status=0) begin insert into oa_BulletinUser(BulletinID,AttachmentGUID,ToUserID,IsRead,ReadTime,CreateTime,ZMSCompanyID) values(@bulletinid,‘‘,@userid,0,null,GETDATE(),@zmscompanyid) fetch next from PlatformBulletin into @userid,@zmscompanyid end close PlatformBulletin --关闭游标 deallocate PlatformBulletin --释放游标 end
以上是关于sql 2008 游标的主要内容,如果未能解决你的问题,请参考以下文章