Hi All,
I´m test for 24200 rows, the cursor done in 35 seconds and the tabla with identity in 84 seconds.
But when i modify the WHILE control for an constant the final time is 35 seconds, equal to cursor.
BEGIN
CREATE TABLE #temp(id INT IDENTITY(1,1), name VARCHAR(32), salary float)
INSERT INTO #temp
SELECT name, salary FROM #emp
DECLARE @i INT, @last INT
SELECT @Last = COUNT(id) FROM #temp
SET @i = 1
WHILE (@i <= @last )
BEGIN
UPDATE #emp
SET salary = (salary * 115)/100
WHERE #emp.id = @i
SET @i = @i + 1
END
END