cursor 小例
declare mycursor cursor scroll dynamicforselect customerid,address from bin_retailcustomer where delflag = '0' and areaid = '' and address like '%十巷%'open mycursordeclare @id bigintdeclare @address v.
·
declare mycursor cursor scroll dynamic
for
select customerid,address from bin_retailcustomer where delflag = '0' and areaid = '' and address like '%十巷%'
open mycursor
declare @id bigint
declare @address varchar(50)
fetch next from mycursor into @id,@address
while(@@fetch_status = 0)
begin
update bin_retailcustomer set address = replace(@address,'十巷','10巷') where customerid = @id
fetch next from mycursor into @id,@address
end
close mycursor
更多推荐
所有评论(0)