Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
RE MySQL -> Linked Server in MS SQL Server
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Expand all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mike Harknett  
View profile  
 More options Feb 26 2004, 2:18 pm
Newsgroups: mailing.database.myodbc
From: Mi...@kiwiplan.co.nz (Mike Harknett)
Date: Fri, 27 Feb 2004 03:18:39 +0800 (CST)
Local: Thurs, Feb 26 2004 2:18 pm
Subject: RE MySQL -> Linked Server in MS SQL Server
Hi,

Yesterday I posted a question regarding setting up a MySQL db as a linked
server in MS SQL Server, after much messing around I managed it  using the
following :

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 - (Make sure that the user you
use has access permissions to the MysSQL db) once the DSN tested Ok. I went
into Add Linked Serevrs on the SQL Server box (not over the network, you
need to either use the console or something like VNC) defined the Linked
Server using the OLE DB ODBC connector and the DSN that I had just defined -
here I found you need to set on the Security tab, under "For a login not
defined in the list above" the option "Be made using this security context"
and enter the user defined as the UID for the DSN - and password of course.

After that the tables appeared and using query analyser I could get at the
data using the openquery function.. one last trick, I found I had to use the
"Trim()" function on all character columns in my queries, otherwise I got
errors about incorrect lengths.. something along the lines of

select a.* from openquery(MySQLLinkedServer, 'select trim(company_name),
trim(costreet), creditlimit from company') as a

This also works fine to create views, stored procs etc

Hope this helps if anyone is stuck on this

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe:    http://lists.mysql.com/myodbc?unsub=myo...@freebsd.csie.nctu.edu.tw


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Harknett  
View profile  
 More options Mar 1 2004, 7:50 pm
Newsgroups: mailing.database.myodbc
From: Mi...@kiwiplan.co.nz (Mike Harknett)
Date: Tue, 2 Mar 2004 08:50:45 +0800 (CST)
Local: Mon, Mar 1 2004 7:50 pm
Subject: RE: RE MySQL -> Linked Server in MS SQL Server
Hi Pier,

Are you wanting to use SQL Server or Access as your database...it makes =
a
difference

cheers

mike


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Harknett  
View profile  
 More options Mar 2 2004, 4:04 pm
Newsgroups: mailing.database.myodbc
From: Mi...@kiwiplan.co.nz (Mike Harknett)
Date: Wed, 3 Mar 2004 05:04:11 +0800 (CST)
Local: Tues, Mar 2 2004 4:04 pm
Subject: RE: RE MySQL -> Linked Server in MS SQL Server
I've used DTS as a scheduled job to do something similar. You also =
should be
able to it using openquery in triggers. What I've done is set up views =
in
SQL Server using openquery as below

create view dbo.MySQLTableName as select MySQLTableName.* from
openquery(MySQLLinkedServer, 'select * from MySQLTableName) as
MySQLTableName

You can then set triggers on this using normal SQL statements and the
openquery function is hidden from view

Again is data only going one way SQL Server -> MySQL or MySQL -> SQL =
Server
or is it going both ways?

If it's going both ways and you are using triggers watch out for =
circular
references where you update a table, it fires a trigger which updates a
table in the other database which then fires a trigger which tries to =
update
the first table  etc etc...

Good luck

Mike


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google