DECLARE @sehir varchar(11), @sehir_id varchar(20)
DECLARE cr CURSOR FOR
SELECT il_id,adi FROM Iller
OPEN cr
FETCH NEXT FROM cr INTO @sehir_id , @sehir
WHILE @@FETCH_STATUS = 0
BEGIN
UPDATE adresler set il=@sehir_id where il=@sehir
FETCH NEXT FROM cr INTO @sehir_id , @sehir
END
CLOSE cr
DEALLOCATE cr
GO
DECLARE cr CURSOR FOR
SELECT il_id,adi FROM Iller
OPEN cr
FETCH NEXT FROM cr INTO @sehir_id , @sehir
WHILE @@FETCH_STATUS = 0
BEGIN
UPDATE adresler set il=@sehir_id where il=@sehir
FETCH NEXT FROM cr INTO @sehir_id , @sehir
END
CLOSE cr
DEALLOCATE cr
GO