SQL Server でカーソルを使って処理する場合の基本形。
DECLARE @code1       INT
DECLARE @code2       INT
DECLARE @value1      NVARCHAR(10)

DECLARE cur1 CURSOR FOR
SELECT code1, code2, value1
FROM table1
ORDER BY code1, code2

OPEN cur1

WHILE (1 = 1)
BEGIN
    FETCH NEXT FROM cur1
    INTO @code1,  @code2, @value1

    IF (@@FETCH_STATUS <> 0)
        BREAK

    INSERT table2 (
       code1, code2, value1
    ) VALUES (
       @code1, @code2, @value1
    )
END

CLOSE cur1
DEALLOCATE cur1

以上。