How to use Insert Into using Select

Nov 28, 2012 at 1:55 PM

Hi,

I want to copy one table data into another table using

select in insert into

I want to execute query like

"Insert Into TableName Select * from AnotherTable"

Both tables have same structure in database

How can i do this ?

thanks in advance.

Coordinator
Dec 1, 2012 at 8:09 AM

Try this

DBSelectQuery sel = DBQuery.SelectFields("one", "two", "three")
                           .From("OtherTable");

DBQuery ins = DBQuery.InsertInto("MyTable").Fields("one", "two", "three")
                     .Select(sel);

Dec 7, 2012 at 7:10 AM

It Works!!!!!

thanks to u.

you really did a nice job.

thanks again.