Académique Documents
Professionnel Documents
Culture Documents
%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.
DECODE() CASE
function expression DECODE can be conveniently simulated using the T-
SQL CASE expression. Here's an example:
SELECT Sport,
CASE Sport
WHEN 'Cricket' THEN 'England'
WHEN 'Hockey' THEN 'India'
WHEN 'Base Ball' THEN 'America'
ELSE NULL
END AS 'Originating Country'
FROM Sports
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.
If sp_help is providing you with too much
information, then try the ODBC catalog stored
procedure, sp_columns.
SELECT 'Something'
FROM DUAL
SELECT 'Something'
PL/SQL T-SQL
PROGRAMMING 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)
Sequences IDENTITY
It is much simpler in SQL Server to generate a
sequence value for a primary key or a non-key
column.
START No equivalent
WITH...CONNECT Though there's no direct equivalent in T-SQL for
BY clause 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.
Now you can select data from the view, using the
following SELECT statement:
SELECT table_name
FROM TABS