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
-- 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

--加条件了

posted @ 2012-08-02 14:10  Rookier  阅读(233)  评论(0编辑  收藏  举报