--用游标实现循环
Declare @NavigatingZone nvarchar(20)
Declare @PostCode nvarchar(20)
Declare Cur Cursor For Select NavigatingZone,PostCode From TbFitDutyCode
Open Cur
Fetch next From Cur Into @NavigatingZone,@PostCode
While @@fetch_status=0
Begin
Update TbFitDutyCode Set NavigatingZone=@NavigatingZone,PostCode=@PostCode Where NavigatingZone=@NavigatingZone and PostCode=@PostCode
Fetch Next From Cur Into @NavigatingZone,@PostCode
End
Close Cur
Deallocate Cur
Declare @NavigatingZone nvarchar(20)
Declare @PostCode nvarchar(20)
Declare Cur Cursor For Select NavigatingZone,PostCode From TbFitDutyCode
Open Cur
Fetch next From Cur Into @NavigatingZone,@PostCode
While @@fetch_status=0
Begin
Update TbFitDutyCode Set NavigatingZone=@NavigatingZone,PostCode=@PostCode Where NavigatingZone=@NavigatingZone and PostCode=@PostCode
Fetch Next From Cur Into @NavigatingZone,@PostCode
End
Close Cur
Deallocate Cur