• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 946
  • Last Modified:

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
0
transstates
Asked:
transstates
1 Solution
 
Carl TawnSystems 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now