Some of the comparision between Sql Server and Oracle


In the below description it gives some of the comparision between oracle and Sql Server and their usage with some sample example by comparing the Sql Server with Oracle queries. And by knowing this you can select which database will suit for your project.

Sql Server and Oracle Comparision:


Here by in this article we explains difference between SQL Server and Oracle.Which is best to choose for our project.
  • Now in Oracle: Oracle - %TYPE data type

  • Now in Sql Server: SQL Server - Not Equivalent


  • Some added information on this is
    In Oracle the %TYPE data type, lets you to create a variable and have that variable's data type be defined by a table or view column or a PL/SQL package variable.
    There is no equivalent for Oracle's %TYPE datatype in T-SQL, but it can be simulated (not very conveniently though) using User Defined Data types (UDT).
    An example for this is:

    EXEC sp_addtype 'MyType', 'smallint', NULLCREATE TABLE MyTable (i MyType)
    CREATE PROC MyProcASBEGINDECLARE @i MyTypeEND

  • Now in Oracle: Oracle - BEFORE triggers

  • Now in Sql Server: SQL Server - INSTEAD OF triggers


  • Some Added Information on this is
    Use INSTEAD OF trigger in SQL Server as an equivalent to Oracle's BEFORE trigger.
    For more information on INSTEAD OF triggers, see SQL Server Books Online

  • Now in Oracle: Oracle - DECODE() function

  • Now in Sql Server: SQL Server - CASE expression


  • Some Added Information on this is
    DECODE can be conveniently simulated using the T-SQL CASE expression.
    An example is:

    SELECT Sport, CASE SportWHEN 'Cricket' THEN 'England' WHEN 'Hockey' THEN 'India' WHEN 'Base Ball' THEN 'America' ELSE NULL END AS 'Originating Country'FROM Sports

  • Now in Oracle - DESCRIBE

  • Now in SQL Server - sp_help or sp_columns


  • Some Added Information on this is
    There are a lot of alternatives for Oracle's DESCRIBE, in SQL Server.
    You could use the system stored procedure sp_help for detailed information about a table's columns and other properties.
    If sp_help is providing you with too much information, then try the ODBC catalog stored procedure, sp_columns.

    There are a bunch of other useful sp_help* stored procedures available in SQL Server. You can find more information about those in SQL Server Books Online.
    If none of those procedures are suitable for your requirements, then you could query the system view INFORMATION_SCHEMA.COLUMNS, to get the desired information.
    You could wrap your code inside a stored procedure named DESCRIBE, if you wish.

  • Now in Oracle - DUAL table

  • Now in SQL Server - No equivalent


  • Some Added Information on this is
    There is no DUAL table in SQL Server.
    In fact, you don't need one in SQL Server, as you can have a SELECT statement without a FROM clause.

    An example is:
    consider the following SELECT statement in Oracle:

    SELECT 'Something'FROM DUAL


    Thus these are some of the comparision that has been done between Sql Server and Oracle.


    Comments

    No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: