Syntax Difference between MS Sql and My Sql

I got some problem with the guys that they want to know the exact difference between the syntax of MS Sql and My Sql. So I like to write this article on this blog. As you see my articles, I have also write an article for the commercial difference between these two Databases. You can see this article on the following url:

https://vijaymodi.wordpress.com/2007/03/28/my-sql-vs-ms-sql/

Now I like to give the syntax difference between these two databases. Let me start it now…

> If you want to retrieve the first (Top) four rows from a table by using query you have to write TOP in MS Sql. While for the same purpose, you need to write LIMIT in mysql. The syntax are as follows:

MS SQL:

SELECT TOP(4) * FROM TableName ORDER BY FieldName

MY Sql:

SELECT * FROM TableName ORDER BY FieldName LIMIT 4

> My Sql can insert multiple rows at a time, while MS Sql cannot.

MS SQL:

INSERT INTO tablename VALUES (1,'AAA');
INSERT INTO tablename VALUES (2,'BBB');
INSERT INTO tablename VALUES (3,'CCC');

MY SQL:

INSERT INTO tablename
VALUES (1,'AAA') , (2,'BBB') , (3,'CCC');

> MSSQL doesn't have CHARACTER_LENGTH. Provides the LEN and DATALENGTH functions instead (the latter is especially valid for 'special' data types like the TEXT type).while MYSQL Provides CHARACTER_LENGTH.
Aliases: CHAR_LENGTH, LENGTH. Note that MySQL removes trailing (not leading) spaces from CHAR values before counting.

To See the other more important difference visit the following link:

http://troels.arvin.dk/db/rdbms/

About these ads

About Vijay Modi

Having 10+ years of experience in web application development. Expertise in various domains like E-Commerce, E-Learning, Insurance. I have expertise in web application development, window application development, Performance improvement, bug fixing etc. I am believing in quality work and achieving deadlines. Also like to work on new technologies and quick learner.
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

18 Responses to Syntax Difference between MS Sql and My Sql

  1. Idetrorce says:

    very interesting, but I don’t agree with you
    Idetrorce

  2. Vijay Modi says:

    hi Idetrorce,

    Let me know, why are you not agree? So that I can change it. Thank you for comment.

    Vijay Modi

  3. hi says:

    Hi To all

  4. suvarna says:

    very good..Thank you for cleared my doubt and also very new. You given that answer with example very good.

  5. kumar says:

    Thank you for your information

  6. narendra says:

    hey i wanna added n more diff —-Technical – As of versions 4.x MySQL does not support views, triggers, stored procedures, user defined functions, XML, while all these are suported by MS SQL
    Non Technical – MS SQL is an expensive (*relatively*) proprietory RDBMS developed & owned by Microsoft Corporation while MySql is an open source RDBMS developed & maintained by MySQL AB of sweden with free as well as paid enterprise versions available.

  7. sourabh jhunjhunwala says:

    kkkkkkkkkkkkk

  8. Lorenzo Lowrince says:

    Does MySql support using the CURSOR?

  9. durga says:

    please help me in linux environment , i use my sql but in windows environment use ms-sql. how can i install ms-sql in linux machine…

  10. Vijay Modi says:

    Hi Lorenzo Lowrince ,

    yes MySQL Supports CURSOR. Read the following article for this.

    http://www.roseindia.net/sql/mysql-example/mySQL-cursor.shtml

    Regards,
    Vijay Modi

  11. Pankaj Kumar says:

    not so good

  12. mdrafeek says:

    very interresting

  13. Pingback: MSSQL vs(Syntax) MySQL | ViMã Software Solution

  14. Ashwin Singh says:

    Someone is messing with thumbs. Involve captcha and accounts

  15. Kobus Beets says:

    Hi there,

    Thank you for this post. I just want to make sure that I understand the MSSQL syntax correctly after reading this post.

    * Is the syntax exactly the same as MySQL? Except for some small change you mentioned within your post. eg. TOP(4) instead of LIMIT 4.

    Are there any more changes in the syntax that I should be aware of when using the MSSQL database engine? I’ve been using MySQL for years now and MSSQL seems to be a little different.

    Thank you

  16. Snowball119 says:

    Vijay,

    Your post is helpful. My team is carrying out a migration of some applications from Microsoft platforms to LAMP.

    To add to you list of Syntax differences, it’s crucial to look into all of the date function differences between MSSQL and MySQL. Here is a URL with the difference date functions listed:

    http://www.w3schools.com/sql/sql_dates.asp

    Thanks,
    Snowball119

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s