Home All Groups Group Topic Archive Search About

Newbie Q: How to Combine data from two tables from two different databases

Author
4 Jul 2006 6:17 AM
Michelle
Hi

I have two separate SQL server databases:  DB1  and DB2

Both databases contains similar tables and I have to combine some of the
like tables together.
If I create an INSERT INTO statement, how do I reference the DB1 and DB2
specific tables?

I will be appreciative for responses or links to areas that I can further
read up.

TIA
Michelle

Author
4 Jul 2006 6:36 AM
Tibor Karaszi
SELECT ... FROM DB1.dbo.tblname

Show quote
"Michelle" <nospam_mbytwo-news@yahoo.com.au> wrote in message
news:12ak1vpj5epfn00@corp.supernews.com...
> Hi
>
> I have two separate SQL server databases:  DB1  and DB2
>
> Both databases contains similar tables and I have to combine some of the like tables together.
> If I create an INSERT INTO statement, how do I reference the DB1 and DB2 specific tables?
>
> I will be appreciative for responses or links to areas that I can further read up.
>
> TIA
> Michelle
>
>
Author
4 Jul 2006 9:50 AM
Michelle
Thank you for your reply.  Much appreciated

Michelle


Show quote
"Tibor Karaszi" <tibor_please.no.email_kara***@hotmail.nomail.com> wrote in
message news:ewyCnQznGHA.4864@TK2MSFTNGP04.phx.gbl...
> SELECT ... FROM DB1.dbo.tblname
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
>
> "Michelle" <nospam_mbytwo-news@yahoo.com.au> wrote in message
> news:12ak1vpj5epfn00@corp.supernews.com...
>> Hi
>>
>> I have two separate SQL server databases:  DB1  and DB2
>>
>> Both databases contains similar tables and I have to combine some of the
>> like tables together.
>> If I create an INSERT INTO statement, how do I reference the DB1 and DB2
>> specific tables?
>>
>> I will be appreciative for responses or links to areas that I can further
>> read up.
>>
>> TIA
>> Michelle
>>
>>
>
>
Author
7 Jul 2006 8:26 AM
Thomas
Use http://www.sqlscripter.com to script you data.

Show quote
"Michelle" wrote:

> Hi
>
> I have two separate SQL server databases:  DB1  and DB2
>
> Both databases contains similar tables and I have to combine some of the
> like tables together.
> If I create an INSERT INTO statement, how do I reference the DB1 and DB2
> specific tables?
>
> I will be appreciative for responses or links to areas that I can further
> read up.
>
> TIA
> Michelle
>
>
>

AddThis Social Bookmark Button