Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Copy Table
Fri, May 28 2010 3:46 AMPermanent Link

Josselin

Hi,

I have two Database (Data1 and Data2).

I would like to copy a table from the Database "Data1" to the Database "Data2", how can I do that ?

Thanks for your response

Bruno
Fri, May 28 2010 4:26 AMPermanent Link

Uli Becker

Josselin,

> I would like to copy a table from the Database "Data1" to the Database "Data2", how can I do that ?

Use this to create an empty table:

Create table MyTable as select * from Data1.MyTable with no data;

To copy the records as well, use:

Create table GoAdressen as select * from Easymail.Adressen with data;

and execute it in the context of Database Data2.

Uli
Fri, May 28 2010 4:28 AMPermanent Link

Uli Becker

Oups, I pasted a wrong line. Here the correct statements:

Use this to create an empty table:

Create table MyTable as select * from Data1.MyTable with no data;

To copy the records as well, use:

Create table MyTable as select * from Data1.MyTable with data;

and execute it in the context of Database Data2.

Uli
Fri, May 28 2010 7:13 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Bruno


I'm not sure wether that copies the indices, triggers etc or not. I just looked in the OLH and I can't figure it out from there but I don't think so.

Roy Lambert
Fri, May 28 2010 9:11 AMPermanent Link

Uli Becker

Roy,

> I'm not sure wether that copies the indices, triggers etc or not. I just looked in the OLH and I can't figure it out from there but I don't think so.

You are right - it just copies the table, nothing else.

Uli
Image