DECLARE @ID decimal
SET @ID = 0
DECLARE #cursor CURSOR FOR
(SELECT _ID FROM _TABLE)
OPEN #cursor
FETCH NEXT FROM #cursor
WHILE @@FETCH_STATUS = 0
BEGIN
UPDATE _TABLE
SET _ID = @ID + 1
WHERE CURRENT OF #cursor
SET @ID = @ID + 1
FETCH NEXT FROM #cursor
END
CLOSE #cursor
DEALLOCATE #cursor
bir tablonun id alanina deger atamak
Gönderen
pantepember
9 Temmuz 2010 Cuma
Etiketler: current of , cursor , identity column , sql