Hot Lines: +92 321 8488 463 & +1 786 2179 794
Portal HomeClient AreaAnnouncementsKnowledgebaseSupport TicketsDownloads

Knowledgebase
You are here: Portal Home > Knowledgebase > Data Bases > What is differnce between Mysql And Mssql

What is differnce between Mysql And Mssql

Some of the difference between MSSQL and MYSQL Syntax are as follows:

1) MSSQL support UDD(User Defined DataTypes), MYSQL does not support UDD

2) Use of -- for comment a line purpose in MSSQL, in otherside use /* */ or -- comments

3) Use prefix @symbol for variable in MSSQL, whereas in MYSQL remove @symbol. e.g. declare @test int -- MSSQL Syntax declare test int; --MYSQL Syntax

4) End marker(;) not required in MSSQL but in MYSQL all statement end with marker (;)

5) In MSSQL use SELECT getdate() for getting today's date , in MYSQL use SELECT now()

6) All queries should be available in Begin tran and Commit(Rollback) tran loop in MSSQL, whereas MYSQL Start transaction and commit(Rollback) transaction.

7) Getting Top most record in MSSQL, Use SELECT TOP1 from Table_Name where In MYSQl SELECT from Table_Name where limit 1;

8) For viewing table information use Sp_help Table_name in MSSQL, but in MYSQL use show table_name;

9) Use of + for concatenate two stings in MSSQLL whereas MYSQL SELECT concat('a','/','b') 10)In MSSQL SP_HELPTEXT for viewing the content of sp in otherside use the following syntax. select routine_definition from information_schema.routines where specific_name = and routine_schema = ;

11)For assigning value to variable use Set @variable1 = 'test' in MSSQL, but in MYSQL use Set variable =1 or set 1 into variable1;

12)In MSSQl, use of IF statement syntax, if Begin Statement end Else Begin Statement end Whereas in MYSQL, if Then Statement; leave sp_label; end if;

13) In MSSQL Use RETURN Statement for returning values but in MYSQL use leave sp_level;

14) The convert datatype Syntax in MSSQL is select convert(type,expression) whereas in MYSQL select convert(expression,type);

15) In MSSQL the Dynamic SQL statement is SELECT @a ='SELECT * from Table_Name where execute (@a) otherside Prepare stmt1 from 'select * from Table_Name where column_name =?' Set @a ='Value'; execute stmt using @a;

Some other Differnces are :

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:

SELECT age
FROM person
ORDER BY age ASC
LIMIT 1 OFFSET 2

in MSSQL (T-SQL):

SELECT TOP 3 WITH TIES *
FROM person
ORDER BY age ASC



Microsoft SQL Server

Did you mean: Microsoft SQL Server, Microsoft SQL Server (technology), mSQL (technology)



MSSQL : Microsoft SQL Server is a relational database management system (RDBMS) produced by Microsoft. Its primary query languages are MS-SQL and T-SQL.

MySQL is a relational database management system (RDBMS)[1] which has more than 11 million installations.[2] The program runs as a server providing multi-user access to a number of databases.

 



Was this answer helpful?

Add to Favourites
Print this Article

Also Read
Sql 2008 R2 Management (Views: 150)
Connecting to an SQL database (Views: 110)
How to Detach a Database (SQL Server Management Studio) (Views: 173)
How to connect to the MySQL database (Views: 115)
How to connect to the MySQL server remotely (Views: 120)

Powered by WHMCompleteSolution


Language:

Copyright © 2011 NavicoSoft , All rights reserved.