Solved

Copying a record from Table1 To Table1

Posted on 2011-02-15
3
939 Views
Last Modified: 2012-05-11
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
Comment
Question by:transstates
3 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 34900063
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
 
LVL 3

Expert Comment

by:DEVLitehouse
ID: 34900086
Yes, this is actually very straightforward. Please give the table definition, and I'll work out the SQL for you.
0
 

Author Comment

by:transstates
ID: 34900412
Right on!  

Thanks.  That did it!

Jim
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question