Page 1 of 1

Can I import a table from another database

Posted: Fri Feb 26, 2016 3:22 pm
by Peter_w
Hello,
How can I insert table values from one database to another database?

Re: Can I import a table from another database

Posted: Sat Feb 27, 2016 7:42 pm
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.