首页 文章

如何将MYSQL查询转换为MSSQL查询

提问于
浏览
2

我有700个MySQL查询,现在尝试在MSSQL中创建相同的查询集 .

我想用相同的MYSQL生成MSSQL查询 . 任何方式将MYSQL查询转换为MSSQL查询 .

1 回答

  • 2

    articleBrian Swan,您可以下载SQL Server Migration Assistant for MySQL tool并使用它将单个MySQL查询转换为SQL Server查询:

    • 创建项目:下载SSMA,创建项目和连接数据库所需的所有信息均在this blog post的步骤1-6中 .

    • 在MySQL Metadata Explorer中,导航到MySQL数据库的Statements目录:

    enter image description here

    • 将要转换的查询粘贴到查询编辑器窗口中,例如: SELECT post_title, post_date FROM wp_posts ORDER BY post_date LIMIT 5 OFFSET 5;

    enter image description here

    • 返回MySQL元数据资源管理器,右键单击Statements并选择Convert Schema:

    enter image description here

    • 当提示保存更改时,选择是:

    enter image description here

    • 从SQL Server查询编辑器窗口复制转换后的查询:

    enter image description here

    请注意,SSMA不会成功转换所有MySQL查询,但它适用于大多数 . 它不会转换某些特定于MySQL的函数(例如 FOUND_ROW() ) .

相关问题