Copy rows from the same table and update the ID column
INSERT INTO ProductDefinition (ProdID, Definition, Desc)
SELECT
xxx, Definition, Desc
FROM
ProductDefinition
WHERE
ProdID = yyy
The xxx
is your new ProdID and the yyy
is your old one. This also assumes that DefID
is automagically populated on INSERT
.
This will work with any column you choose. Not just primary key/ID.
INSERT INTO TableName (Column1, CustomID, Column3, Column4, Column5)
SELECT Column1, 'NewValue', Column3, Column4, Column5 FROM TableName
WHERE CustomID='OrigValue'