PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > syncing data between mssql and mysql
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
syncing data between mssql and mysql

Réponse
 
LinkBack Outils de la discussion
Vieux 11/02/2008, 16h44   #1
Michael
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut syncing data between mssql and mysql

I have an application that uses M$SQL as the backend. I also have
associated applications that run on a LAMP server. I'd like to setup
MySQL to have a copy of the M$SQL backend data and that is updated
when changes are made to the M$SQL backend via the application so my
programmer can do his PHP magic on the data and make everything work
together.

I've found some older documentation that suggests that I could setup a
linked server on the M$SQL server and then create triggers to
synchronize the table data. I've performed some initial testing by way
of creating an idetical tablle in MySQL and then linking M$SQL to the
MySQL server with an ODBC connection. I'm stuck now because my older
documentation isn't what I need for the newer versions of the
software.

I'm using M$SQL 2005 and MySQL 5.0.26. I'm looking for some good
documentation to follow for the setup. I can setup so that M$SQL
pushes the data changes or so MySQL pulls the data changes to the
database in question.

  Réponse avec citation
Vieux 11/02/2008, 17h46   #2
Michael
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: syncing data between mssql and mysql

On Feb 11, 10:44 am, Michael <michaelfromtheb...@gmail.com> wrote:
> I have an application that uses M$SQL as the backend. I also have
> associated applications that run on a LAMP server. I'd like to setup
> MySQL to have a copy of the M$SQL backend data and that is updated
> when changes are made to the M$SQL backend via the application so my
> programmer can do his PHP magic on the data and make everything work
> together.
>
> I've found some older documentation that suggests that I could setup a
> linked server on the M$SQL server and then create triggers to
> synchronize the table data. I've performed some initial testing by way
> of creating an idetical tablle in MySQL and then linking M$SQL to the
> MySQL server with an ODBC connection. I'm stuck now because my older
> documentation isn't what I need for the newer versions of the
> software.
>
> I'm using M$SQL 2005 and MySQL 5.0.26. I'm looking for some good
> documentation to follow for the setup. I can setup so that M$SQL
> pushes the data changes or so MySQL pulls the data changes to the
> database in question.


I've found a product, dbqwiksynch, that I used to create the identical
structure from M$SQL to MySQL. It worked as advertised. Now I need to
get this M$SQL database to update the MySQL database without from
third-party apps.
  Réponse avec citation
Vieux 11/02/2008, 20h59   #3
Michael
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: syncing data between mssql and mysql

On Feb 11, 11:46 am, Michael <michaelfromtheb...@gmail.com> wrote:
> On Feb 11, 10:44 am, Michael <michaelfromtheb...@gmail.com> wrote:
>
>
>
> > I have an application that uses M$SQL as the backend. I also have
> > associated applications that run on a LAMP server. I'd like to setup
> > MySQL to have a copy of the M$SQL backend data and that is updated
> > when changes are made to the M$SQL backend via the application so my
> > programmer can do his PHP magic on the data and make everything work
> > together.

>
> > I've found some older documentation that suggests that I could setup a
> > linked server on the M$SQL server and then create triggers to
> > synchronize the table data. I've performed some initial testing by way
> > of creating an idetical tablle in MySQL and then linking M$SQL to the
> > MySQL server with an ODBC connection. I'm stuck now because my older
> > documentation isn't what I need for the newer versions of the
> > software.

>
> > I'm using M$SQL 2005 and MySQL 5.0.26. I'm looking for some good
> > documentation to follow for the setup. I can setup so that M$SQL
> > pushes the data changes or so MySQL pulls the data changes to the
> > database in question.

>
> I've found a product, dbqwiksynch, that I used to create the identical
> structure from M$SQL to MySQL. It worked as advertised. Now I need to
> get this M$SQL database to update the MySQL database without from
> third-party apps.


Now I have created tiggers in M$SQL that should insert/update/delete
to a table that is in both databases. Here is the syntax for the
triggers:

CREATE TRIGGER ScoffLaw_insert ON [dbo].[ScoffLaw]
FOR INSERT
AS
SET XACT_ABORT ON
INSERT INTO OPENQUERY(PRODUCTION, 'Select * from ScoffLaw')
SELECT Scofflaw_Key, Code, Type, Data, License_State,
License_Type, License_Color, Source, ExpDate, IssDate,
Entry_By, Entry_Date, Product_Source FROM INSERTED

GO

CREATE TRIGGER ScoffLaw_update ON [dbo].[ScoffLaw]
FOR UPDATE
AS
SET XACT_ABORT ON
DELETE FROM OPENQUERY(PRODUCTION, 'Select * from ScoffLaw')
WHERE Scofflaw_Key IN (SELECT Scofflaw_Key FROM DELETED)
INSERT INTO OPENQUERY(PRODUCTION, 'Select * from ScoffLaw')
SELECT Scofflaw_Key, Code, Type, Data, License_State,
License_Type, License_Color, Source, ExpDate, IssDate,
Entry_By, Entry_Date, Product_Source FROM INSERTED

GO

CREATE TRIGGER ScoffLaw_delete ON [dbo].[ScoffLaw]
FOR DELETE
AS
SET XACT_ABORT ON
DELETE FROM OPENQUERY(PRODUCTION, 'Select * from ScoffLaw')
WHERE Scofflaw_Key IN (SELECT Scofflaw_Key FROM DELETED)

GO

Now the issue is that I'm getting an error message through the
application that uses the M$SQL server as the back end.

SYSTEM ERROR ENCOUNTERED
LOCATION: cmdSave_Click
ERROR#: -2147467259
DESC: [Microsoft][ODBC SQL Driver ][SQL Server]OLE DB providor
"MSDASQL" for linked server "PRODUCTION" returned message "[MySQL]
[ODBC 3.51 Driver]Optional feature not supported"

I believe that this has something to due with the link and not having
sufficient privileges to make the insertion/update/delete action. I
have set the linked server object to use a username password
combination that has been setup on the mySQL server for this.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 08h01.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,64046 seconds with 11 queries