Jun 25, 2009

Oracle SQL vs MS SQL

Oracle
1: Statements ending with ;(; is Compulsory)
Eg. select * from a;
Eg. select count(*) from a;
--but for single select or insert query you can omit
2: field with "" take as single field, but for a field white spaces not there, you can omit the double quote.
Eg. select "Employee Name",Address from Employee;
3: Oracle comparition is case sensitive.
Eg.select * from Employee where Status='Active'; is different than select * from Employee where Status='ACTIVE';
4: System date command as SYSDATE
Eg. Update Employee set JoinDate=SYSDATE where JoinDate is null;
5: For variable character : nvarchar2,for Datetime field: date
6: procedure declaration : create or replace PROCEDURE abc() as begin [statement blog] end;
7: No any Bit or Boolean Data type
8: Variable declaration not using any special keywords
Eg. com_var nvarchar2;

MS SQL
1: Statements ending with ;(; is not Compulsory)
Eg. select * from a
Eg. select count(*) from a

2: field with [] take as single field, but for a field white spaces not there, you can omit the [].
Eg. select [Employee Name],Address from Employee;
3: MS Sql comparitions are not case sensitive.
Eg.select * from Employee where Status='Active' and select * from Employee where Status='ACTIVE' are equal
4: System date command as getdate()
Eg. Update Employee set JoinDate=getdate()where JoinDate is null;
5: For variable character : nvarchar(50),for Datetime field: datetime
6: procedure declaration : create PROCEDURE abc() as begin [statement blog] end;
7: Bit for Boolean Data type
8: Declare word is compulsory for variable declaration;
Eg. Declare com_var nvarchar(50)