从MySql到sql server的数据转换 [英] Data conversion from MySql To sql server

查看:153
本文介绍了从MySql到sql server的数据转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Friends,

我要求我需要将现有数据从mysql转换为sqlserver。

mysql的现有数据格式为.sql文件所以我需要将其转换为

sql server。



我使用该脚本数据并在新查询窗口中运行但它显示了一些错误,

sql server中没有mysql的某些关键字。



请帮帮我.....

在此先感谢..........

Hello Friends,
I have a requirement that i need to convert existing data from mysql to sqlserver.
Existing data of mysql is in the format of .sql file and so i need to convert this to
sql server.

I use that script data and run in New Query Window but it shows some error that
some keywords of mysql are not present in sql server.

Please help me.....
Thanks in Advance..........

推荐答案

您需要使用MySQL ODBC驱动程序(请务必下载适当的版本您的MySQL数据库;该链接用于版本3.51)创建到MySQL服务器的链接服务器,然后运行SQL查询以逐表复制您的数据库。查询是(写入特定于您的服务器的数据库名称,服务器名称,用户和密码

You need to use the MySQL ODBC driver (be sure to download the appropriate version for your MySQL Database; the link is for version 3.51) to create a Linked Server to the MySQL Server, and then run a SQL query to copy your database, table by table. The query is (write the database name, server name, user and password specific to your server
EXEC master.dbo.sp_addlinkedserver @server = N'MYSQL', @srvproduct=N'MySQL', @provider=N'MSDASQL', @provstr=N'DRIVER={MySQL ODBC 3.51 Driver}; SERVER=127.0.0.1; DATABASE=Db_NAME; USER=myusername; PASSWORD=mypass; OPTION=3'





然后你必须按表复制你的数据库表。其中一个表的代码是:





Then you’ll have to copy your database table by table. The code for one of the tables will be:

select * into MSSQL_DB_Name.dbo.TableName
from openquery(MySQL, 'select * from Db_Name.TableName')





试试这个



Try this


这篇关于从MySql到sql server的数据转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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