Take the 2-minute tour ×

I'm an ASP.NET developer who has used Microsoft SQL Server for all my database needs (both at work and for personal projects). I considering trying out the LAMP stack for some of my personal projects. What are some of the main differences between MySQL and MS SQL? Are using Stored Procedures a common practice in MySQL? Any advice or resources you'd recommend to help me with the switch? To those who have experience with both, are there any missing features from MySQL?

share|improve this question

closed as not constructive by Andrew Barber Jun 8 '13 at 4:44


13 Answers 13

up vote 60 down vote accepted

One thing you have to watch out for is the fairly severe differences in the way MSSQL and MySQL implement the SQL syntax.

Here's a nice Comparison of Different SQL Implementations.

For example, take a look at the top-n section. In MySQL:

FROM person


FROM person
share|improve this answer
and oracle is different too: select * from (select age from person order by ago asc) where rownum <= 3 Come back ANSI SQL, all is forgiven :) –  gbjbaanb Sep 18 '08 at 14:47
Just ran across this. Reading about all the differences makes me cringe. The basics are the same (at least in terms of understanding), but the specifics are very, very different. –  JasCav May 13 '10 at 18:21

Lots of comments here sound more like religious arguments than real life statements. I've worked for years with both MySQL and MSSQL and both are good products. I would choose MySQL mainly based on the environment that you are working on. Most open source projects use MySQL, so if you go into that direction MySQL is your choice. If you develop something with .Net I would choose MSSQL, not because it's much better, but just cause that is what most people use. I'm actually currently on a Project that uses ASP.NET with MySQL and C#. It' works perfectly fine.

share|improve this answer

MySQL is more likely to have database corruption issues, and it doesn't fix them automatically when they happen. I've worked with MSSQL since version 6.5 and don't remember a database corruption issue taking the database offline. The few times I've worked with MySQL in a production environment, a database corruption issue took the entire database offline until we ran the magic "please fix my corrupted index" thing from the commandline.

MSSQL's transaction and journaling system, in my experience, handles just about anything - including a power cycle or hardware failure - without database corruption, and if something gets messed up it fixes it automatically.

This has been my experience, and I'd be happy to hear that this has been fixed or we were doing something wrong.



share|improve this answer
myIsam is meant for really quick responses, it does not have forced foreign key check in reason to be quicker. Try using InnoDB engine if doing something more serious. I had some really nasty problems with MS Access, and can't forgive them for such irresponsibility, so I do not favorize any of MS's databases, let them do OSes, and give serious business to open source community... although you cannot be sure of anything since Oracle had overtaken MySQL.. –  ante.sabo Sep 1 '10 at 8:11
Fair enough, but that's silly to ignore Microsoft databases based on Access. Access it is a desktop database and has nothing to do with SQL Server. You know StackOverflow runs on SQL Server, right? –  Jon Galloway Sep 1 '10 at 22:59

Frankly, I can't find a single reason to use MySQL rather than MSSQL. The issue before used to be cost but SQL Server 2005 Express is free and there are lots of web hosting companies which offer full hosting with sql server for less than $5.00 a month.

MSSQL is easier to use and has many features which do not exist in MySQL.

share|improve this answer
people who down vote need to say why they disagree. –  Abdu Nov 7 '08 at 8:42
I think price is the only real reason to choose MySQL over MSSQL. Sure, there is some cheap MSSQL hosting but it is rare and often severely limited on storage. –  Craig Nov 23 '08 at 20:28
sql server storage is like 100M-500M. For a regular website this seems plenty. –  Abdu Apr 20 '09 at 0:22
I would say that the licensing is a pretty good reason to go with MySQL. –  Dr. Mike Sep 2 '13 at 12:11
So far my issues are that are mySQL does not support table based variable types and also you cannot reopen temp tables. Pretty much show stoppers for me. –  realtek Apr 8 at 21:39

Everything in MySQL seems to be done closer to the metal than in MSSQL, And the documentation treats it that way. Especially for optimization, you'll need to understand how indexes, system configuration, and the optimizer interact under various circumstances.

The "optimizer" is more a parser. In MSSQL your query plan is often a surprise (usually good, sometimes not). In MySQL, it pretty much does what you asked it to do, the way you expected it to. Which means you yourself need to have a deep understanding of the various ways it might be done.

Not built around a good TRANSACTION model (default MyISAM engine).

File-system setup is your problem.

All the database configuration is your problem - especially various cache sizes.

Sometimes it seems best to think of it as an ad-hoc, glorified isam. Codd and Date don't carry much weight here. They would say it with no embarrassment.

share|improve this answer

I can't believe that no one mentioned that MySQL doesn't support Common Table Expressions (CTE) / "with" statements. It's a pretty annoying difference.

share|improve this answer
I've used both CTEs as well as temp/variable tables. What would be the benefit of using a CTE over the latter two? –  Jared May 12 at 19:36
@Jared Using CTEs keeps the code readable because you don't need to define a temp table and it's column types and by using cte you even get an intellisense for the column type and name even you didn't specified them. –  Aleks Aug 21 at 8:22

I think one of the major things to watch out is that versions prior to MySQL 5.0 did not have Views, Triggers, and Stored Procedures.

More of this is explained in the MySQL 5.0 Download page

share|improve this answer

Anyone have any good experience with a "port" of a database from SQL Server to MySQL?

This should be fairly painful! I switched versions of MySQL from 4.x to 5.x and various statements wouldn't work anymore as they used to. The query analyzer was "improved" so statements which previously were tuned for performance would not work anymore as expected.

The lesson learned from working with a 500GB MySQL database: It's a subtle topic and anything else but trivial!

share|improve this answer


The main thing I've found that MySQL has over MSSQL is timezone support - the ability to nicely change between timezones, respecting daylight savings is fantastic.

Compare this:

mysql> SELECT CONVERT_TZ('2008-04-01 12:00:00', 'UTC', 'America/Los_Angeles');
| 2008-04-01 05:00:00                                             |

to the contortions involved at this answer.

As for the 'easier to use' comment, I would say that the point is that they are different, and if you know one, there will be an overhead in learning the other.

share|improve this answer
Also, correct ansi support for group by, automatic timestamp columns, MUCH simpler paging... –  Joel Coehoorn Oct 2 '08 at 14:49
MySQL's timezone support is significantly broken, I don't think that's a useful feature. Do it in the application instead. –  MarkR Nov 23 '08 at 20:38
I haven't had any problems with timezone support, could you go into some more details or provide a link please? –  Cebjyre Dec 16 '08 at 4:13

Spending some time working with MySQL from the MSSQL to MySQL syntax POV I kept finding myself limited in what I could do.

There are bizzare limits on updating a table while refrencing the same table during an update.

Additionally UPDATE FROM does not work and last time I checked they don't support the Oracle MERGE INTO syntax either. This was a show stopper for me and I stopped thinking I would get anywhere with MySQL after that.

share|improve this answer

Both are DBMS's Product Sql server is an commercial application while MySql is an opensouces application.Both the product include similar feature,however sql server should be used for an enterprise solution ,while mysql might suit a smaller implementation.if you need feature like recovery,replication,granalar security and significant,you need sql server

MySql takes up less spaces on disk, and uses less memory and cpu than does sql server

share|improve this answer


Anyone have any good experience with a "port" of a database from SQL Server to MySQL? I use views all the time - it surprises me that MySQL did not support it until 5.0. I'd be curious as to people's experience with Stored Procedures, Views, Triggers, Constraints, Etc in MySQL?

share|improve this answer

@Cebjyre. The IDE whether Enterprise Manager or Management Studio is better than anything I have seen so far for MySQL. I say 'easier to use' because I can do many things in MSSQL where MySQL has no counterparts. In MySQL I have no idea how to tune the queries by simply looking at the query plan or looking at the statistics. The index tuning wizard in MSSQL takes most of the guess work on what indexes are missing or misplaced.

One shortcoming of MySQL is there's no max size for a database. The database would just increase in size till it fills up the disk. Imagine if this disk is sharing databases with other users and suddenly all of their queries are failing because their databases can't grow. I have reported this issue to MySQL long time ago. I don't think it's fixed yet.

share|improve this answer
On the other hand, I've been annoyed by the management studio console not respecting undo properly (it's possible to have a valid query that it chokes on, because it doesn't realise the text has been updated), and the lack of tab-expansion (compared to mysql shell). There are minuses on both sides. –  Cebjyre Dec 16 '08 at 4:17
