SQL to copy a record and insert it using a specified new primary key
Posted on 2011-02-16
I have an 80 coluimn table with lots of records and the Primary key is a column named OrderNum (and is NOT an identity field). I need to insert a new record with all identitical values as an existing record based on the OrderNum, except obviously the OrderNum can't be the same, so I need to assign the newly inserted OrderNum.
What would be the best SQL statement to accomplish this?
Let's say the record I need to copy is OrderNum=100500
and I need to assign the new record Ordernum=101880