I have the following query that has been working so far. I modified
it slightly to work from another source table (new_products). Now,
SQL Server complains that the identity is inherited already:
"Cannot add identity column, using the SELECT INTO statement, to table
'dbo.my_product s', which already has column 'id' that inherits the
identity property."
Any suggestions for a work aorund?
This is the query:
SELECT IDENTITY(INT,1, 1) as seq_number, prod_number, prod_name
INTO my_products
FROM ( SELECT prod_number, prod_name
FROM new_products
WHERE ...
ORDER BY ...) sub_table
it slightly to work from another source table (new_products). Now,
SQL Server complains that the identity is inherited already:
"Cannot add identity column, using the SELECT INTO statement, to table
'dbo.my_product s', which already has column 'id' that inherits the
identity property."
Any suggestions for a work aorund?
This is the query:
SELECT IDENTITY(INT,1, 1) as seq_number, prod_number, prod_name
INTO my_products
FROM ( SELECT prod_number, prod_name
FROM new_products
WHERE ...
ORDER BY ...) sub_table
Comment