Jump to content

Recommended Posts

I am needing to translate a SQL Server statement to MySQL and I was hoping to find an easy opensource translator that I can paste in the SQL Server statement and it translate it to what the MySQL statement should be or something of that effect.

 

Thank you all in advance.

Link to comment
https://forums.phpfreaks.com/topic/268619-sql-server-statement-to-mysql-statement/
Share on other sites

I doubt such a tool exists, and if there is I doubt it's reliable. TL-SQL has features MySQL does not, and vice versa. These go beyond switching one keyword for another, and when you factor in differences in each language across their versions, it's just not feasible. Such a migration requires a developer or DBA to do it manually.

Alternatively you can use a DBA (Database Abstraction) class, but that would require a rewrite of the source code anyway. The benefit of this however, is that you'll only need to do the code rewrite once, as the DBA class will create the proper SQL sentences and syntax for you. The negative aspect of these is that they tend to implement only a subset of the functionality, or become complicated behemoth like nothing else.

It's not all bad though, as the subset tends to be what the vast majority of queries use anyway.

 

I've written one of these classes, so I should know. Unfortunately, I've only got the MySQL component of it, as I'm not familiar enough with the other SQL dialects to write the query builders for them myself (yet).

That said, there should be some other DBA classes out there, or some other plugins that might help you automate most of this. Not aware of any tools that translates the queries themselves though, as that's more of a domain of the Database Administrators (Adam's DBAs).

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.