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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Connecting to mySQL from SQL Server 2005

Author  Topic 

bi89405
Starting Member

35 Posts

Posted - 2011-01-13 : 22:16:21
I was able to successfully create a linked server to a mySQL db using the query below:


exec sp_addlinkedserver
@server='serverName',
@srvproduct='databaseName',
@provider='MSDASQL',
@datasrc='ODBCName',
@provstr='DATABASE=databaseName;DSN=ODBCName;OPTION=0;PWD=;SERVER=localhost;UID=User'


Now, the next thing I'd like to do is query against the mySQL database but it's not working:


select * from openquery(serverName, 'select * from ODBCName.clienthistory')


Can anyone please tell me what I am doing wrong? Thanks!

Sachin.Nand

2937 Posts

Posted - 2011-01-13 : 23:41:18
The syntax looks ok for me.What error are you getting ?

PBUH

Go to Top of Page
   

- Advertisement -