Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Recordset from 2 different databases?

Author  Topic 

rtown
Yak Posting Veteran

53 Posts

Posted - 2010-10-29 : 13:03:42
Not sure if this is possible. I have data on 2 tables which reside on two different databases, one being mssql, and the other mysql. Both have a field with matching id numbers.

I am displaying the data from the mysql table, and want to display a column from the mssql table where the id's match.

Possible??? If so, I dont know where to start, any help appreciated!

X002548
Not Just a Number

15586 Posts

Posted - 2010-10-29 : 13:36:58
You need to set up a linked server from SQL Server or a process to import the data

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx





Go to Top of Page

rtown
Yak Posting Veteran

53 Posts

Posted - 2010-10-29 : 13:40:33
But im not importing anything... the data exists on both tables I just need to display them both in one table, where id numbers match.
Go to Top of Page

rtown
Yak Posting Veteran

53 Posts

Posted - 2010-10-29 : 14:03:30
Thanks for the links. A revised question, can I do a SQL JOIN select statement with tables on ms.sql and my.sql... two different connection strings...
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-11-01 : 12:14:29
yup. for that you might need to use distributed query method like OPENROWSET. Alternatively you could add MySQL server as a linked server in mssql and then use table as normal table using four part naming convention (MySQLServer.MySQLDB.schema.Table)

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -