Can I import a table from another database

Post Reply
Peter_w
Posts: 28
Joined: Tue Aug 19, 2008 9:28 am

Can I import a table from another database

Post by Peter_w »

Hello,
How can I insert table values from one database to another database?
chris
Site Admin
Posts: 194
Joined: Mon Jul 21, 2008 9:52 am

Re: Can I import a table from another database

Post by chris »

Sure you can,

just go to the database where you want too add the new data,
and add the following query:

Code: Select all

INSERT INTO TargetTable(field1, field2, field3)
  SELECT field1, field2, field3 FROM SourceDatabase.SourceTable
     WHERE (some condition)
Assuming the databases are on the same server.
Post Reply