mysql example 连接查询,SELECT * FROM链接的MySQL服务器

I have a SQL Server 2012.(120.120.55.15)

Today I linked MySQL server(120.120.55.30) to my SQLServer and gave it a name "MYSQL".

In Object Explorer everything seems fine. I can see MySQL server's database "exampleDataBase" and tables in it.

But when I try to run select query like this:

SELECT *

FROM openquery

(

MYSQL,

'

SELECT *

FROM [exampleDataBase].[msProcMatrix]

'

)

I get a mistake:

Msg 7399, Level 16, State 1, Line 1 The OLE DB provider "MSDASQL" for

linked server "MYSQL" reported an error. The provider did not give any

information about the error. Msg 7350, Level 16, State 2, Line 1

Cannot get the column information from OLE DB provider "MSDASQL" for

linked server "MYSQL".

What should be additionally done to use my linked MySQL server?

解决方案

Found the decision:

SELECT *

FROM openquery(MYSQL, 'SELECT * FROM exampleDataBase.msProcMatrix')

Without brackets!

Strange for me but works...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值