Copying a record from Table1 To Table1

Hello All,

What I'm wanting to do is copy a record from table1 then copy it back to table1 with a new partnumber.  Part Number is a key field.

Question:  Is there a way to do this using a sql statement.

Thanks in advance!

Jim
transstatesAsked:
Who is Participating?
 
Carl TawnConnect With a Mentor Systems and Integration DeveloperCommented:
Yes, you can do something along the lines of:
INSERT INTO Table1 ( [partnumber], [List of other columns] )
    SELECT 'newpartnumber', [List of other columns] FROM Table1 WHERE [comparisoncolumn] = somevalue;

Open in new window

0
 
DEVLitehouseCommented:
Yes, this is actually very straightforward. Please give the table definition, and I'll work out the SQL for you.
0
 
transstatesAuthor Commented:
Right on!  

Thanks.  That did it!

Jim
0
All Courses

From novice to tech pro — start learning today.