How to insert data from one table to another?

Please help!! How do I INSERT INTO lots of inforamtion at one time in SQL?

  • Hello, Can you please show me using the following inforamtion HOW to INSERT INTO a table all the data at one time ...I tried it and it only lets me insert one persons info. at a time and Im trying to learn SQL. Thanks!! Here is what I tried to do, is this wrong and were ? Thanks Insert into Yahoo_00025 (first,last,title,age) Values ( 'lucy','ricardo','actress',40),('ethel',… Can you please tell me what Im doing wrong ? Thanks so much :)

  • Answer:

    If you're using constants you need an insert statment for every record. If the data is in another table you would use and insert with a select. INSERT INTO T1 (F1,F2) SELECT F1,F2 FROM T2

Thalassa... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

That's just how it works. You can use a SELECT INTO statement if you are inserting data from one table into another, or a CURSOR for a similar purpose. Otherwise, your front end application will typically use a loop to run INSERT statements one-by-one. If you needed to do a bulk load of data into a table, you'd be better off using a Data Transformation Services task.

What DBMS (and the version) are you using? Try this Insert into Yahoo_00025 (first,last,title,age) select 'lucy', 'ricardo', 'actress', 40 UNION ALL select 'ethel',... ...

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.