?
Solved

Insert Statement

Posted on 2015-01-07
10
Medium Priority
?
178 Views
Last Modified: 2015-01-07
Hello,

Will a INSERT statement work for taking a record from one table to another?
0
Comment
Question by:Jass Saini
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 19

Expert Comment

by:Eric Sherman
ID: 40536059
Yes, can you be a little more specific in what you are trying to accomplish.

ET
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40536061
yes

Insert into tablex(f1,f2)
select f1,f2 from tableY
0
 
LVL 18

Expert Comment

by:Simon
ID: 40536069
Insert into tbl1 (txtCol)
select txtAnotherCol from tbl2
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

Author Comment

by:Jass Saini
ID: 40536082
Would it be okay to insert from one table to another when the col are different or do they have to be the same.  Where in the property should the action happen?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40536114
the names of columns may not be the same, BUT the number of columns must be the Same and the Data types must be the same.
0
 
LVL 18

Assisted Solution

by:Simon
Simon earned 1000 total points
ID: 40536115
The order of the values clause and the select clause are what matters

insert into t1 (col3,col1)
select col2,col4 from t2

In this case col2 gets inserted in col3 of the table t1 and col4 gets inserted into col1 of t1.

Datatypes should be the same or coercible (e.g. numeric to string, but not alphanumeric string to numeric);.
0
 

Author Comment

by:Jass Saini
ID: 40536149
So should I use a COPY button to to copy that over...also...sorry forget this ..

Some of my fields that I need to copy are on the main form and others are the sub form.  Will that be okay?
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 1000 total points
ID: 40536210
omg,,, @JAss SAini
please stick to the original problem that you posted..
when you got a solution, close the thread AND OPEN a new question for another problem.
0
 

Author Comment

by:Jass Saini
ID: 40536223
OK Thank you Rey...it is still part of the same problem.
0
 

Author Closing Comment

by:Jass Saini
ID: 40536224
Thank you
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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 …
Suggested Courses

749 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