你所在位置:首页Sql资源 → sql游标语句

sql游标语句

发布时间:2019-06-12


sql游标语句

 

declare @Weekday char(50)

declare cur_data cursor for

select travelNum from dbo.TravelBaseInfo WHERE destinations NOT LIKE '%/'

open cur_data

fetch next from cur_data into @Weekday

while(@@fetch_status = 0) 

begin  www.350job.com  

-- set @sql=@id+@displayorder+@type+@code+@url

UPDATE TravelBaseInfo SET destinations=destinations+'/' WHERE travelNum=@weekday

 

--print @sql

fetch next from cur_data into @Weekday

end

close cur_data 

deallocate cur_data

--加条件了

 

 

作者 Rookier


上一篇:mssql方便的函数使用与游标使用练习
下一篇:让数据库游标变得简单