select add column wtih row number code example
Example: create row number in 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;
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;