Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

How to create a view on SQLServer 2008 as an OPENQuery select to a MYSQL linked server

$
0
0

I am trying to create a view on SQLServer through Management Studio based on data on a MYSql server.

I have created the Linked server and I am able to query all data.

Using the syntax select * from OPENQUERY (linkedServer, 'select * from MYSQL-table') - This works fine

What I am trying to do now is issue the following statement

create view ViewnameToBeCreatedOnSQLServer

   as select * from OPENQUERY (linkedServer, 'select * from MYSQL-table')

When I run this from SSMS I get the following error

-----------

OLE DB provider "MSDASQL" for linked server "TESTTSC2" returned message "[MySQL][ODBC 5.1 Driver][mysqld-5.0.95-log]Table 'FP.M3' doesn't exist".

Msg 7350, Level 16, State 2, Procedure FPMaster3, Line 2

Cannot get the column information from OLE DB provider "MSDASQL" for linked server "TESTTSC2".

-------------

The account I am using has create view privs and alter schema privs on the SQlServer side. I am assuming there are not isues on the MYSQL server side since I am able to successfully run the select statement using OPENQUERY.  There must be one small piece I am missing. has anyone experienced the same problem and were you able to find a solution?


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>