R: RE MySQL -> Linked Server in MS SQL Server

R: RE MySQL -> Linked Server in MS SQL Server

Post by Pierfrancesco Consol » Tue, 02 Mar 2004 20:03:15



Ok! This works, but what about modifying fields in the MySQL Linked
Server ?
I have this problem from long ago.=20
I'm waiting for a new ODBC driver with at least the ability to send two
distinct command as a workaround for the need for the openquery call to
have something in return.=20

Eg:=20
select a.* from openquery(MySQLLinkedServer, 'INSERT INTO company
(company_name, costreet, creditlimit) VALUES ("A", 10.10 , 10.10);
select trim(company_name), trim(costreet), creditlimit from company')

Or there is something I don't understand (or some trick with MySQL
stored procedures) ?

Bye

Pier

P.S.: Sorry for my english

> -----Messaggio originale-----

> Inviato: gioved=EC 26 febbraio 2004 20.20

> Oggetto: RE MySQL -> Linked Server in MS SQL Server
>=20
>=20
> Hi,
>=20
> Yesterday I posted a question regarding setting up a MySQL db=20
> as a linked server in MS SQL Server, after much messing=20
> around I managed it  using the following :
>=20
> The key was to instal the ODBC driver on the box that SQL=20
> Server was sitting on. Once I did that I defined a System DSN=20
> - (Make sure that the user you use has access permissions to=20
> the MysSQL db) once the DSN tested Ok. I went into Add Linked=20
> Serevrs on the SQL Server box (not over the network, you need=20
> to either use the console or something like VNC) defined the=20
> Linked Server using the OLE DB ODBC connector and the DSN=20
> that I had just defined - here I found you need to set on the=20
> Security tab, under "For a login not defined in the list=20
> above" the option "Be made using this security context" and=20
> enter the user defined as the UID for the DSN - and password=20
> of course.
>=20
> After that the tables appeared and using query analyser I=20
> could get at the data using the openquery function.. one last=20
> trick, I found I had to use the "Trim()" function on all=20
> character columns in my queries, otherwise I got errors about=20
> incorrect lengths.. something along the lines of
>=20
> select a.* from openquery(MySQLLinkedServer, 'select=20
> trim(company_name), trim(costreet), creditlimit from company') as a
>=20
> This also works fine to create views, stored procs etc
>=20
> Hope this helps if anyone is stuck on this
>=20
> --=20
> MySQL ODBC Mailing List
> For list archives: http://lists.mysql.com/myodbc
> To unsubscribe:   =20

>=20
>=20

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc

 
 
 

R: RE MySQL -> Linked Server in MS SQL Server

Post by Pierfrancesco Consol » Wed, 03 Mar 2004 18:40:03


I have to work with two real power database as MS SQL Server and MySQL
Server on two distinct server machine (Windows 2000 and True 64 Unix).

No problem using Access to (near) 'manually' modify both database
tables, but I think that the daily data migration I need should be done
on one of the two server in a more automatic way (eg: with DTS & MS SQL
batch jobs or, better, with field triggers, or, on the other side,
perhaps by Unix cron scripts).

Bye.

Pier

> -----Messaggio originale-----

> Inviato: marted=EC 2 marzo 2004 1.52

> Oggetto: RE: RE MySQL -> Linked Server in MS SQL Server
>=20
>=20
> Hi Pier,
>=20
> Are you wanting to use SQL Server or Access as your=20
> database...it makes a difference
>=20
> cheers
>=20
> mike
>=20
> -----Original Message-----

> Sent: Tuesday, 2 March 2004 0:01

> Cc: 'Mike Harknett'
> Subject: R: RE MySQL -> Linked Server in MS SQL Server
>=20
>=20
> Ok! This works, but what about modifying fields in the MySQL=20
> Linked Server ? I have this problem from long ago.=20
> I'm waiting for a new ODBC driver with at least the ability=20
> to send two distinct command as a workaround for the need for=20
> the openquery call to have something in return.=20
>=20
> Eg:=20
> select a.* from openquery(MySQLLinkedServer, 'INSERT INTO=20
> company (company_name, costreet, creditlimit) VALUES ("A",=20
> 10.10 , 10.10); select trim(company_name), trim(costreet),=20
> creditlimit from company')
>=20
> Or there is something I don't understand (or some trick with=20
> MySQL stored procedures) ?
>=20
> Bye
>=20
>=20
> Pier
>=20
> P.S.: Sorry for my english
>=20
>=20
> > -----Messaggio originale-----

> > Inviato: gioved=EC 26 febbraio 2004 20.20

> > Oggetto: RE MySQL -> Linked Server in MS SQL Server
> >=20
> >=20
> > Hi,
> >=20
> > Yesterday I posted a question regarding setting up a MySQL db
> > as a linked server in MS SQL Server, after much messing=20
> > around I managed it  using the following :
> >=20
> > The key was to instal the ODBC driver on the box that SQL
> > Server was sitting on. Once I did that I defined a System DSN=20
> > - (Make sure that the user you use has access permissions to=20
> > the MysSQL db) once the DSN tested Ok. I went into Add Linked=20
> > Serevrs on the SQL Server box (not over the network, you need=20
> > to either use the console or something like VNC) defined the=20
> > Linked Server using the OLE DB ODBC connector and the DSN=20
> > that I had just defined - here I found you need to set on the=20
> > Security tab, under "For a login not defined in the list=20
> > above" the option "Be made using this security context" and=20
> > enter the user defined as the UID for the DSN - and password=20
> > of course.
> >=20
> > After that the tables appeared and using query analyser I
> > could get at the data using the openquery function.. one last=20
> > trick, I found I had to use the "Trim()" function on all=20
> > character columns in my queries, otherwise I got errors about=20
> > incorrect lengths.. something along the lines of
> >=20
> > select a.* from openquery(MySQLLinkedServer, 'select
> > trim(company_name), trim(costreet), creditlimit from company') as a
> >=20
> > This also works fine to create views, stored procs etc
> >=20
> > Hope this helps if anyone is stuck on this
> >=20
> > --
> > MySQL ODBC Mailing List
> > For list archives: http://lists.mysql.com/myodbc
> > To unsubscribe:   =20
> > http://lists.mysql.com/myodbc?> =


Quote:> >=20
> >=20
>=20

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc


 
 
 

1. MySQL -> Linked Server in MS SQL Server

Hi,

I'm trying to set up a MySQL database running on a Linux box as a Linked
server in MS SQL Server on a WIndows 2000 box, using MySQL ODBC Connector
3.51, and am having problems.

I can set up a linked server if both DB's (MySQL and MSSQL Server) are
running on a Windows2000 box, and I can use DTS in SQL Server to retrieve
data from the LInux MySQL Db using the ODBC Connector.

Any pointers to documentation, suggestions would be very welcome

Cheers

Mike Harknett

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc

2. annoying mails

3. RE MySQL -> Linked Server in MS SQL Server

4. DNS Help

5. MyODBC 3.51.01, OleDB, MS SQL Server And Linked Servers

6. DoD Community Contingency Planners' Guide

7. R: MyODBC 3.51.01, OleDB, MS SQL Server And Linked Servers (Multiple-statements ??)

8. Help! How can I get Russian (Cyrillic) character set?

9. MyODBC 3.51.01, OleDB, MS SQL Server And Linked Servers

10. MySQL Server as Linked Server to MSSQL Server?

11. MySQL-SQL Server Linked Server Problem

12. ms SQL server 7.0 -- > mysql?

13. MS SQL 2k5 linked server to Postgresql