Oracle | SQL Server | More Information |
%TYPE data type | No equivalent | The %TYPE data type of Oracle, lets you create a variable and have that variable's data type be defined by a table or view column or a PL/SQL package variable. |
BEFORE triggers | INSTEAD OF triggers | Use INSTEAD OF trigger in SQL Server as an equivalent to Oracle's BEFORE trigger. |
DECODE() function | CASE expression | DECODE can be conveniently simulated using the T-SQL CASE expression. Here's an example: |
DESCRIBE | sp_help or sp_columns | 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. |
DUAL table | No equivalent | 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. |
INTERSECT operator | Not supported | Use EXISTS clause to generate the same result. |
MINUS operator | Not supported | Use NOT EXISTS clause in your SELECT statement to generate the same result. |
Nested tables | Not supported | Oracle 8i and prior versions didn't support this feature and is introduced in Oracle 9i. This feature basically enables you to store a table, within a column. It is like having an array of records in your database columns. |
Oracle | SQL Server | :-) |
Packages | Not supported | No equivalent in SQL Server for Oracle's Packages and Package variables concept |
PL/SQL | T-SQL | Every database product implements and extends the standard SQL. Oracle's implementation of SQL is called PL/SQL, while Microsoft's is called T-SQL (Transact-SQL) |
Row level security | No equivalent | Though there is no inbuilt support in SQL Server for row level permissions, you can implement it using view and system functions. |
rownum pseudo column | No equivalent | Though there is no rownum or rowid in SQL Server, there are several ways in which a row number can be generated. |
SELECT...FOR UPDATE | UPDLOCK hint | Use the locking hint UPDLOCK in your SELECT statement. |
Sequences | IDENTITY | It is much simpler in SQL Server to generate a sequence value for a primary key or a non-key column. |
SQL *Plus | Query Analyzer | For connecting to SQL Server and executing queries and modifying data, use the built-in Query Analyzer. It is much more powerful and friendlier than Oracle's SQL *Plus |
START WITH...CONNECT BY clause | No equivalent | Though there's no direct equivalent in T-SQL for Oracle's START WITH...CONNECT BY, there are several ways and efficient techniques for processing and querying hierarcical data. |
Synonym | Views | You can simulate Oracle Synonyms in SQL Server using Views. For example, the following creates a view that returns the OrderID and OrderDate from Orders table. |
Technical blog discussing various programming languages, frameworks and paradigms. Code snippets and projects are also provided.
Tuesday, 25 August 2009
T-SQL vs. PL/SQL
Here are some of the differences between Oracle's PL/SQL and SQL Server's T-SQL.
Subscribe to:
Post Comments (Atom)
1 comment:
wonderful piece of information, I had come to know about your blog from my friend Nandu , Hyderabad, I have read at least 7 posts of yours by now, and let me tell you, your website gives the best and the most interesting information. This is just the kind of information that I had been looking for, I'm already your RSS reader now and I would regularly watch out for the new posts, once again hats off to you! Thanks a ton once again, Regards, sql and plsql difference
Post a Comment