Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to design a database schema that can be used with both MySQL and SQL Server?

I'd like to give customers a choice of the database engine, but also want to minimize my troubles of such a decision.
The engines in question are MySQL (5 or later) and SQL Server (2005 or later).

like image 364
z-boss Avatar asked Dec 17 '22 10:12

z-boss


1 Answers

Google for the differences in datatypes.

But the schema is just a part of the picture.

The SQL dialects are different too. Google for those differences. Then, either stick to a subset of SQL that's common to both, or build in a scheme to use somewhat different SQL in each.

Don't wait until the end to test on the "other" db. Test on both from the start so that you don't invest too much in a dead end design direction.

Here's a starting place:
http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/mysql.mspx#EZD
and:
http://troels.arvin.dk/db/rdbms/#insert

like image 90
Corey Trager Avatar answered Jan 13 '23 03:01

Corey Trager