将数据从My Sql导入Sql Server的最简单方法

问题描述:

对于新项目,我必须从MySql导入预先存在的数据。

For a new project I have to import the pre-existing data from MySql.

这个网站我找到了很多选项,其中一些包括安装驱动程序。什么是最快的&最简单的方法吗?

In this site I have found many options, some including the installation of drivers. What is the fastest & easiest way to do it?

更新:这只是一次导入

-- Create Link Server

EXEC master.dbo.sp_addlinkedserver 
@server = N'MYSQL', 
@srvproduct=N'MySQL', 
@provider=N'MSDASQL', 
@provstr=N'DRIVER={MySQL ODBC 5.1 Driver}; SERVER=localhost; _
     DATABASE=tigerdb; USER=root; PASSWORD=hejsan; OPTION=3'

-- Import Data

SELECT * INTO testMySQL.dbo.shoutbox
FROM openquery(MYSQL, 'SELECT * FROM tigerdb.shoutbox')