I have a table A and there is one primary key ID.
Now I want to go through all rows in A.
I found something like \'for each record in A\', but this seems to
You should really use a set based solution involving two queries (basic insert):
INSERT INTO TableB (Id2Column, Column33, Column44)
SELECT id, column1, column2 FROM TableA
UPDATE TableA SET column1 = column2 * column3
And for your transform:
INSERT INTO TableB (Id2Column, Column33, Column44)
SELECT
id,
column1 * column4 * 100,
(column2 / column12)
FROM TableA
UPDATE TableA SET column1 = column2 * column3
Now if your transform is more complicated than that and involved multiple tables, post another question with the details.