How can I insert values into table variable from another table by adding a column that counts original records. e.g.
Value Number Value
---------- ---> ----------------
56 1 56
78 2 78
90 3 90
However, I cannot use an IDENTITY(1,1) to automatically generate counter values because I want to explicitly insert values into Number column. May be I should use CTE?
1 Answer