[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Copying a record from Table1 To Table1

Posted on 2011-02-15
3
Medium Priority
?
943 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 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

865 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