我必须将客户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