MySQL到MSSQL [英] MySQL to MSSQL

查看:70
本文介绍了MySQL到MSSQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里遇到了很大的问题!我有一个在Godaddy上存在的MySQL数据库.我正在开发一个可以从MSSQL数据库运行的.Net应用程序.建立了mssql数据库,并且应用程序随之出现,但是我需要一种将MySQL数据库合并到MSSQL的方法.通常,这将是一个简单的任务,但是MySQL数据库中包含的原始信息,肿,不完整且不一致.

反过来,我无法进行海峡转换.我需要一种从MySQL数据库生成select语句并将信息插入MSSQL的方法.是否可以通过这种方式在两个数据源之间进行通信?

原始数据库仍在使用,因此我需要一个现在可以进行测试的过程,但是稍后在应用程序完成并准备实现时进行复制.

此外,GoDaddy不允许我将存储过程提交到MySql数据库.

I am having a huge issue here! I have a MySQL database that exists on Godaddy. I am developing a .Net application that works off of a MSSQL database. The mssql database is built and the application coming along, however I need a way to merge the MySQL database to MSSQL. Normally this would be a simple task, but the original information contained in the MySQL database is bloated, incomplete, and inconsistent.

In turn, I cannot do a strait conversion. I need a way of producing a select statement from the MySQL database and insert information into MSSQL. Is there a way to communicate between the two data sources in this way?

The original database is still being used, so I need a process that can be tested now, but duplicated later when the application is complete and ready to implement.

In addition, GoDaddy will not allow me to commit stored procedures to the MySql database.

推荐答案

好,您创建了一个Web服务,该服务公开了一个方法,例如: br/>
[WebMethod]
公共数据集RunSQL(字符串sql)
{
//运行SQL并返回数据的代码

}

然后,在新项目中创建对该Web服务的引用.如果您担心安全性,请计算出IP地址并使Web服务仅对此作出响应.然后,编写运行SQL的代码以请求每个表的内容.然后,您需要遍历该内容并进行清理,然后再将其插入本地SQL Server数据库中.
Well, you create a webservice, which exposes a method, something like:

[WebMethod]
public DataSet RunSQL(string sql)
{
// code to run the SQL and return the data

}

Then you create a reference to that webservice in your new project. If you''re worried about security, work out your IP address and make the web service only respond to that. Then, you write code that runs SQL to request the content of each table. Then you iterate over that content and sanitise it before inserting it into your SQL Server database locally.


您可以在您的Godaddy网站(仍然是地球上最糟糕的Web主机)上放置一个Web服务,这使您可以从MySQL请求数据.我正在考虑采用一个SQL字符串并返回一个数据集的东西.然后,您可以编写一个调用Web服务,过滤数据并将其插入的程序.听起来很杂乱,但看起来似乎是逻辑路径.
You could put a webservice on your godaddy site ( still the worst web host on earth BTW ), which allows you to request data from your MySQL. I am thinking of something that takes a SQL string and returns a dataset. Then, you could write a program which calls the webservice, filters the data and inserts it. Sounds messy, but it seems like the logical path.


您能为此提供示例或摘要吗?我对整个事情还是很陌生,这是我第一次必须处理类似的事情.
Can you provide a example or rundown for this? I am still pretty new to the whole thing, and this is my first time having to deal with something like this.


这篇关于MySQL到MSSQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆