Garayed.com  

Go Back   Garayed.com > mySQL
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-07-2007, 07:27 PM
Nick Mudge
 
Posts: n/a
Default INSERT SELECT with multiple databases

Hello,

I want to do an insert select, where data from one table in one
database is copied into another table in another database. The
databases are on the same server. The tables have the same structure.

I have tried: INSERT INTO db1.table SELECT * FROM db2.table
but I keep getting this error: Incorrect table name

Is it possible to do an INSERT SELECT with different databases on the
same server?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-07-2007, 08:43 PM
Dikkie Dik
 
Posts: n/a
Default Re: INSERT SELECT with multiple databases

> I have tried: INSERT INTO db1.table SELECT * FROM db2.table
> but I keep getting this error: Incorrect table name
>
> Is it possible to do an INSERT SELECT with different databases on the
> same server?
>


I tried the same, but without "db1.", so from the database "db1":

use db1;
INSERT INTO table SELECT * FROM db2.table;

No problems whatsoever.

Best regards.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:37 PM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.