Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert MS SQL script to Mysql and Oracle

One of the applications I develop gets installed locally on the customer's site. This means that we have to support MySQL, MSSQL and Oracle as not all the customers use the same database engine.

I'm writing a patch for the application, part of which involves executing a 5000 line sql script to make modifications to the database. The script is written using MSSQL syntax, however I was wondering if there is an application for automatically converting MSSQL syntax to that of Oracle and/or MySQL to save me from having to manually do it.

like image 318
user169743 Avatar asked Sep 07 '09 14:09

user169743


People also ask

How do I convert MS SQL database to MySQL step by step?

However, you need to set up the ODBC (Open Database Connectivity) Driver to up the connection between these databases. You can achieve this by following the steps given below: Step 1: Configure the ODBC Driver to Convert SQL Server to MySQL. Step 2: Use the MySQL Migration Wizard to Convert SQL Server to MySQL.

Can Microsoft SQL Server run Oracle?

You can use the Microsoft SQL Server Management Studio to connect your Oracle data to an SQL Server instance. Linked Server is a tool of MS SQL Server that allows to execute distributed queries to refer tables stored on non-SQL Server datbase in a single query.


4 Answers

For conversion to Oracle you can try the Migration Workbench.

like image 197
Adam Hawkes Avatar answered Oct 24 '22 09:10

Adam Hawkes


This is an old topic, but i would recommend using the following tool: http://www.sqlines.com/online. I had a good experience using it. No problems found since 3 months ago (when i've started using it).

like image 21
VulfCompressor Avatar answered Oct 24 '22 09:10

VulfCompressor


And even more concerning is that the databases support different locking mechanisms, so you may be able to get some tables and indexes in there, but you might introduce some issues that are very difficult to debug/replicate when you expose it into the wild.

You need as 3 experts to sort that lot out - one each of SQL Server, MySQL and Oracle. That or your database needs to run with a maximum of one user, with poor performance and very average database mechanisms.

Sorry...

like image 36
Chris Gill Avatar answered Oct 24 '22 08:10

Chris Gill


I don't know of a database engine programming syntax converter. However, since you're working on a multi-database platform, I would consider using Enterprise Library and its application block. This will save you headaches, you got to trust me!

I am aware that you parhaps don't have enough time for your coming releases so you will have to setup the scripts manually, but do yourself a favour, and consider using Microsoft Enterprise Library.

Another possible way is to bring these engines as close as possible to each other in ressemblance so that you may work more conveniently with the three of them. Thus, it requires you to analyze and to decide what function should be created where and why? This is hard work, seriously.

In my own experience, I no longer develop without Enterprise Library, at least the Data Application block (DAAB).

Here the link:

  1. http://www.microsoft.com/downloads/details.aspx?FamilyId=1643758B-2986-47F7-B529-3E41584B6CE5&displaylang=en
  2. http://www.codeplex.com/entlib

Let me know if this helped you. If you need further assistance for setting up your Data Access layer with Enterprise Library, let me know.

EDIT 2015.01.16

Another best approach these days is the use of either NHibernate, Entity Framework or other ORM tools such as these.

With them, no longer need any SQL scripts, all is generated for you in depending on your RDBMS configuration.

like image 27
Will Marcouiller Avatar answered Oct 24 '22 09:10

Will Marcouiller