I am trying to copy data from one table to another, and in the process
add a sequence number to copied rows. I have looked at the IDENTITY
function when creating tables, and essentially this is the behavior I
am trying to duplicate.
However, my question is if I can do this with the SELECT INTO
statement as well. I have tried a few variations and it does not seem
to work:
SELECT seq_number = identity(10),
prod_number,
prod_name
INTO my_products
FROM all_products
WHERE ....
add a sequence number to copied rows. I have looked at the IDENTITY
function when creating tables, and essentially this is the behavior I
am trying to duplicate.
However, my question is if I can do this with the SELECT INTO
statement as well. I have tried a few variations and it does not seem
to work:
SELECT seq_number = identity(10),
prod_number,
prod_name
INTO my_products
FROM all_products
WHERE ....
Comment