如何将MYSQL查询转换为MSSQL查询 [英] How to convert MYSQL query into MSSQL query

查看:237
本文介绍了如何将MYSQL查询转换为MSSQL查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I've 700+ MySQL queries and now trying to create same set of queries in MSSQL.

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

I want to generate MSSQL query with same MYSQL.Is any way to convert MYSQL query into MSSQL query.

推荐答案

来自此"SQL Server MySQL迁移助手"工具,并使用该工具将单个MySQL查询转换为SQL Server查询:

From this article by Brian Swan, you can download the SQL Server Migration Assistant for MySQL tool and use it to convert a single MySQL query to a SQL Server query:

  1. 创建项目:下载SSMA,创建项目和连接数据库所需的所有信息位于在MySQL Metadata Explorer中,导航到MySQL数据库的Statements目录:

    In the MySQL Metadata Explorer, navigate to the Statements directory of your MySQL database:

    1. 将要转换的查询粘贴到查询编辑器窗口中,例如: SELECT post_title, post_date FROM wp_posts ORDER BY post_date LIMIT 5 OFFSET 5;
    1. Paste the query you want to convert into the query editor window, e.g: SELECT post_title, post_date FROM wp_posts ORDER BY post_date LIMIT 5 OFFSET 5;

    1. 返回MySQL元数据浏览器,右键单击Statements并选择Convert Schema:

    1. 当系统提示您保存更改时,选择是":

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

    请注意,SSMA无法成功转换所有MySQL查询,但大多数情况下都可以转换.它不翻译某些特定于MySQL的功能(例如FOUND_ROW()).

    Note that SSMA will not successfully translate all MySQL queries, but it does for most. It does not translate some MySQL-specific functions (for example FOUND_ROW()).

    这篇关于如何将MYSQL查询转换为MSSQL查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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