It is possible to tool to transform in one SQL query of 1 database to a different?

For SQLite

> CREATE TABLE ConstantValues(    Id int
> AUTOINCREMENT primary key   ,
> VariableName varchar(50)    , Values
> varchar(150) )

For SQL Server

> CREATE TABLE ConstantValues(    Id
> INTEGER identity(1,1) primary key   ,
> VariableName varchar(50)   , Values
> varchar(150) )

Similarly it's different for Oracle and SQL Server. Also within the foreign key constraints declaration, if there's something to ensure that we are able to get SQL from the database to the database, it might be really useful for me personally.

I've produced a function such as this, however it does not appear to become a good solution:

private string changeSQL(string sql)
    switch (dbtype)
        case dbType.SQLite:
            sql = sql.Replace(" int ", " INTEGER ");
            sql = sql.Replace(" identity(1,1) ", " AUTOINCREMENT ");
        case dbType.MsAscess:
            sql = sql.Replace(" int ", " ");
            sql = sql.Replace(" identity(1,1) ", "");
            sql = sql.Replace("AUTOINCREMENT", "AUTOINCREMENT");

    return (sql);

Similarly for SQLite, concatenation is performed using || during SQL Server to control your emotions using +.

SwisSQL Console 5.

Console provides an instant solution supplying fast and reliable SQL query conversion utility that speeds up migration. Console supports migration across Oracle, SQL Server, IBM DB2, MySQL, Sybase, PostgreSQL, Informix and Netezza databases. Miracle traffic bot also offers features to check the converted SQLs in target databases.

Basically would support multiple database management systems, I'd get it done completely, having a Data Access Layer for every system. It'd require some work load, obviously, however the modularity could be quite advantageous.

One alternative I am pleased with, is DevExpress' XPO. This is an Object Relational Mapping system that supports multiple databases. You design your classes, define an effective connection string, and also the database schema is going to be produced for you personally, and you will apply crud for your classes easily in code. To be able to make use of a different database system, just have to change the bond string!

With no, I am not associated with DevExpress apart from like a happy customer.

first you should know and realize that every SQL engine works together with another SQL grammar. Regardless of the SQL ANSI standard, no language on the planet respects it 100%. Furthermore, every large and known SQL engine adds own techniques and stuff towards the original grammar.

So, if you wish to perform a conversion, the simplest strategy is to attain a middle SQL layer. Which means, to produce an agnostic SQL grammar from the common features in each and every well-known SQL engine (it might lead to something similar to SQL ansi plus every feature contained in every engine, like TOP). After you have this, make the conversion for this middle layer, and out of this middle layer for every SQL variation you'll need.

I said this because I desired this exact factor inside my work, which was the only method to really achieve it, and managed to get multiple-use. Getting something provides you with the task to really by hand convert each and every query, making huge SWITCHs just to find the query, or with an inherited class for each engine.

I say to you what I have done: I produced the BNF of my SQL middle grammar, then produced a tree parser with GoldParser for C#. I Quickly produced individual rules for every rule within the grammar to become transformed into each SQL dialect. It is a huge and tiresome job, I understand. But they'd compensated me to get it done...

Without having time to do this, you could utilize ODBC. Every SQL engine comes with an ODBC connector, and also the ODBC itself will behave as a middle abstract layer. But, it is not as happy because it sounds, since simple queries will keep this illusion... hard things like UNION, JOINs, and metadata creation will not function as the same.

I really hope it assisted,

best of luck