Crie o número da linha no SQL
SELECT t.A, t.B, t.C, ROW_NUMBER() OVER (ORDER BY t.A) as newId
FROM dbo.tableZ AS t
ORDER BY t.A;
Motionless Macaque
SELECT t.A, t.B, t.C, ROW_NUMBER() OVER (ORDER BY t.A) as newId
FROM dbo.tableZ AS t
ORDER BY t.A;
SELECT
ROW_NUMBER() OVER (
ORDER BY first_name
) row_num,
first_name,
last_name,
city
FROM
sales.customers;