mysql脚本转化,如何将mySql SQL脚本转换为MS SQL?

我必须将客户MySql数据库架构/数据迁移到MS SQL SERVER 2008.最后我收到了70 Mb的SQL文件,其中mySQL方言与MSSQL不兼容.

DROP TABLE IF EXISTS `kladr`;

CREATE TABLE `kladr` (

`id` int(11) NOT NULL DEFAULT '0',

`idp` int(11) DEFAULT NULL,

...

花了一个星期的谈判才收到这样的文件,所以我不敢让mySQL管理员发给我MS SQL SERVER兼容的sql.有没有办法自动将mySQL方言转换为MSSQL SERVER方言?

解决方法:

最简单的方法是获得转换器.有多种选择可供选择,但可能很难找到一个好的选择:有很多垃圾邮件可供选择,所有这些都是花钱的.

您将需要一些mysql工具和一些mssql工具,如上面的链接所述.

添加一个简短的exerpt:

如果您查看名为“使用数据加载”的部分.您已经拥有的导出文件可能没问题,因此您可以跳过“生成mysqldump数据提取脚本”.

现在你需要的部分:

Using the extracted scripts with SQL Query Analyzer

Generated scripts can now be used to create database objects and insert data. The preferred method to construct a database schema from MySQL scripts is to use the SQL Query Analyzer tool that is included with SQL Server 2000.

You can run SQL Query Analyzer directly from the Start menu, or from inside SQL Server Enterprise Manager. You can also run SQL Query Analyzer from the command prompt by executing the isqlw utility.

In order for the script to correctly execute there is some additional work required, which involves certain changes with the SQL dialect. Also, remember to walk through the SQL script and change the data types to SQL Server compatible types. The diagram below shows an imported script from mysqldump, it is important to note that the dump is an ASCII script file.

标签:mysql,sql,sql-server

来源: https://codeday.me/bug/20190626/1293731.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值