How to combine data from different columns from different databases from different suppliers into one table?

Let's say I have a table called tbl1 in mysql: -

bookid int
name varchar(20)
price int
categoryid int

And then I have a second table, tbl2 in Oracle: -

pubid int
name varchar(20)
addr varchar(50)

I want to combine these two in MS Sql Server 2008 with the name tbl3, the structure of which should be: -

bookid int
name varchar(20)
price int
pubid int
name varchar(20)

Note that I know that tables do not make sense, but I just need to understand if this is possible or not. And if so, how? What queries should I write? I do not want to use Sql Server Integration Services.

Thanks in advance:)

+3
source share
2 answers

, . SQL Server , DTS/SSIS, Linked Servers. , Oracle MySQL, . , Linked Server ORACLESERVER, MYSQLSEVER, - (, name ):

Insert SqlServerDbName.SchemaName.TableName(....)
Select ...
From ORACLESERVER.DbName.SchemaName.tbl1 As T1
    Join MYSQLSERVER.DbName.SchemaName.tbl2 As T2
        On T2.name = T1.name

OPENROWSET .

+1

, . , . 1 2. , . , , .

, select * from table1, table2, ..., tablen. . 12 , 12*12 = 144 .

0

Source: https://habr.com/ru/post/1751619/


All Articles