sql 游标使用
Posted luoguixin
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 游标使用相关的知识,希望对你有一定的参考价值。
declare
@PASSDate datetime,
@VLPN varchar(50),
@VLPNColor varchar(10),
@nambers int
set @VLPN=‘‘;
set @VLPNColor=‘‘;
set @nambers=947383;
Declare rmd Cursor for
select
VLPN,VLPNColor,PASSDATETIME
from
REMOTEDETECTION
where REMOTEDETECTIONID is null;
Open rmd
Fetch Next From rmd Into @VLPN,@VLPNColor,@PASSDate--取第一条记录存入@result中
While ( @@Fetch_Status=0 )
begin
if(@VLPN!=‘‘ and @VLPNColor!=‘‘ and @PASSDate !=‘‘)
begin
update REMOTEDETECTION set [email protected] where [email protected] and [email protected] and [email protected];
set @[email protected]+1;
end;
Fetch Next From rmd into @VLPN,@VLPNColor,@PASSDate; ----下一条
end
Close rmd
Deallocate rmd
以上是关于sql 游标使用的主要内容,如果未能解决你的问题,请参考以下文章